deathrow.c revision 70cbfe41f2338b77c15f79c6625eca6e70c412f3
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * CDDL HEADER START
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * The contents of this file are subject to the terms of the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Common Development and Distribution License (the "License").
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * You may not use this file except in compliance with the License.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * or http://www.opensolaris.org/os/licensing.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * See the License for the specific language governing permissions
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * and limitations under the License.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * CDDL HEADER END
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Use is subject to license terms.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * The service deathrow mechanism addresses the problem of removing services
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * from a non accessible SMF repository. In this case, we can't simply use the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * "SVCCFG_REPOSITORY=$ROOT/etc/svc/repository.db svccfg delete service_fmri"
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * command as the alternate repository format is not committed and could be
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * incompatible with the local SMF commands version.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * The idea is to manage a file (/etc/svc/deathrow) on the alternate root
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * directory that lists the FMRIs that need to disappear from the repository
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * when the system that uses this root directory boots up.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * r.manifest and i.manifest update the file /etc/svc/deathrow in the alternate
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * When svc.startd daemon launches, it first reads the /etc/svc/deathrow file
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * and for all FMRIs listed in this file, the service is not configured and
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * dependencies on it are forced satisfied (during svc.startd init time only).
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Than manifest-import service will actually, as first task, delete the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * unconfigured services found in the /etc/svc/deathrow file and the
typedef struct deathrow {
char *fmri;
} deathrow_t;
static void deathrow_add(const char *);
char *line;
char *fmri;
char *manifest;
char *pkgname;
unsigned int line_parsed = 0;
line_parsed++;
if (sz > 0) {
manifest++;
pkgname++;
deathrow_t *d;
deathrow_t *d;
static deathrow_t *
deathrow_t *d;
return (NULL);
return (B_FALSE);