Print this page
OS-2564 zone boot failed: could not start zoneadmd
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/zoneadmd/zoneadmd.h
+++ new/usr/src/cmd/zoneadmd/zoneadmd.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
25 25 * Copyright 2014, Joyent, Inc. All rights reserved.
26 26 */
27 27
28 28 #ifndef _ZONEADMD_H
29 29 #define _ZONEADMD_H
30 30
31 31 #ifdef __cplusplus
32 32 extern "C" {
33 33 #endif
34 34
35 35 #include <libdladm.h>
36 36
37 37 /*
38 38 * Multi-threaded programs should avoid MT-unsafe library calls (i.e., any-
39 39 * thing which could try to acquire a user-level lock unprotected by an atfork
40 40 * handler) between fork(2) and exec(2). See the pthread_atfork(3THR) man
41 41 * page for details. In particular, we want to avoid calls to zerror() in
42 42 * such situations, as it calls setlocale(3c) which is susceptible to such
43 43 * problems. So instead we have the child use one of the special exit codes
44 44 * below when needed, and the parent look out for such possibilities and call
45 45 * zerror() there.
46 46 *
47 47 * Since 0, 1 and 2 are generally used for success, general error, and usage,
48 48 * we start with 3.
49 49 */
50 50 #define ZEXIT_FORK 3
51 51 #define ZEXIT_EXEC 4
52 52 #define ZEXIT_ZONE_ENTER 5
53 53
54 54 #define DEVFSADM "devfsadm"
55 55 #define DEVFSADM_PATH "/usr/sbin/devfsadm"
56 56
57 57 #define EXEC_PREFIX "exec "
58 58 #define EXEC_LEN (strlen(EXEC_PREFIX))
59 59
60 60 #define CLUSTER_BRAND_NAME "cluster"
61 61 #define LABELED_BRAND_NAME "labeled"
62 62
63 63 #define SHUTDOWN_WAIT 60
64 64 #define SHUTDOWN_DEFAULT "/sbin/init 0"
65 65 #define SHUTDOWN_FMRI "svc:/system/zones:default"
66 66
67 67 /* 0755 is the default directory mode. */
68 68 #define DEFAULT_DIR_MODE \
69 69 (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
70 70 #define DEFAULT_DIR_USER -1 /* user ID for chown: -1 means don't change */
71 71 #define DEFAULT_DIR_GROUP -1 /* grp ID for chown: -1 means don't change */
72 72
73 73
74 74 typedef struct zlog {
75 75 FILE *logfile; /* file to log to */
76 76
77 77 /*
78 78 * The following are used if logging to a buffer.
79 79 */
80 80 char *log; /* remaining log */
81 81 size_t loglen; /* size of remaining log */
82 82 char *buf; /* underlying storage */
83 83 size_t buflen; /* total len of 'buf' */
84 84 char *locale; /* locale to use for gettext() */
85 85 } zlog_t;
86 86
87 87 extern zlog_t logsys;
88 88
89 89 extern mutex_t lock;
90 90 extern mutex_t msglock;
91 91 extern boolean_t in_death_throes;
92 92 extern boolean_t bringup_failure_recovery;
93 93 extern char *zone_name;
94 94 extern char zonepath[MAXNAMELEN];
95 95 extern zone_dochandle_t snap_hndl;
96 96 extern char pool_name[MAXNAMELEN];
97 97 extern char brand_name[MAXNAMELEN];
98 98 extern char default_brand[MAXNAMELEN];
99 99 extern char boot_args[BOOTARGS_MAX];
100 100 extern boolean_t zone_isnative;
101 101 extern boolean_t zone_iscluster;
102 102 extern dladm_handle_t dld_handle;
103 103
104 104 extern void zerror(zlog_t *, boolean_t, const char *, ...);
105 105 extern char *localize_msg(char *locale, const char *msg);
106 106
107 107 /*
108 108 * Eventstream interfaces.
109 109 */
110 110 typedef enum {
111 111 Z_EVT_NULL = 0,
112 112 Z_EVT_ZONE_BOOTING,
113 113 Z_EVT_ZONE_REBOOTING,
114 114 Z_EVT_ZONE_HALTED,
115 115 Z_EVT_ZONE_READIED,
116 116 Z_EVT_ZONE_UNINSTALLING,
117 117 Z_EVT_ZONE_BOOTFAILED
118 118 } zone_evt_t;
119 119
120 120 extern int eventstream_init();
121 121 extern void eventstream_write(zone_evt_t evt);
122 122
123 123 /*
124 124 * Zone mount styles. Boot is the standard mount we do when booting the zone,
125 125 * scratch is the standard scratch zone mount for upgrade and update is a
126 126 * variation on the scratch zone where we don't lofs mount the zone's /etc
127 127 * and /var back into the scratch zone so that we can then do an
128 128 * 'update on attach' within the scratch zone.
129 129 */
130 130 typedef enum {
131 131 Z_MNT_BOOT = 0,
132 132 Z_MNT_SCRATCH,
133 133 Z_MNT_UPDATE
134 134 } zone_mnt_t;
135 135
136 136 /*
137 137 * Virtual platform interfaces.
138 138 */
139 139 extern zoneid_t vplat_create(zlog_t *, zone_mnt_t);
140 140 extern int vplat_bringup(zlog_t *, zone_mnt_t, zoneid_t);
141 141 extern int vplat_teardown(zlog_t *, boolean_t, boolean_t);
142 142 extern int vplat_get_iptype(zlog_t *, zone_iptype_t *);
143 143
144 144 /*
145 145 * Filesystem mounting interfaces.
146 146 */
147 147 extern int valid_mount_path(zlog_t *, const char *, const char *,
|
↓ open down ↓ |
147 lines elided |
↑ open up ↑ |
148 148 const char *, const char *);
149 149 extern int make_one_dir(zlog_t *, const char *, const char *,
150 150 mode_t, uid_t, gid_t);
151 151 extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
152 152
153 153 /*
154 154 * Console subsystem routines.
155 155 */
156 156 extern int init_console(zlog_t *);
157 157 extern void serve_console(zlog_t *);
158 +extern void zcons_statechanged();
158 159
159 160 /*
160 161 * Memory capping thread creation.
161 162 */
162 163 extern void create_mcap_thread(zlog_t *, zoneid_t);
163 164 extern void destroy_mcap_thread();
164 165
165 166 /*
166 167 * Zone FD log thread creation.
167 168 */
168 169 extern void create_log_thread(zlog_t *, zoneid_t);
169 170 extern void destroy_log_thread();
170 171
171 172 /*
172 173 * Contract handling.
173 174 */
174 175 extern int init_template(void);
175 176
176 177 /*
177 178 * Routine to manage child processes.
178 179 */
179 180 extern int do_subproc(zlog_t *, char *, char **);
180 181
181 182 #ifdef __cplusplus
182 183 }
183 184 #endif
184 185
185 186 #endif /* _ZONEADMD_H */
|
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX