mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-25 20:25:27 +00:00
confile: remove lxc.kmsg
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
953fe44f7c
commit
26a38fb6aa
@ -791,25 +791,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Enable kmsg symlink</title>
|
||||
<para>
|
||||
Enable creating /dev/kmsg as symlink to /dev/console. This defaults to 0.
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>lxc.kmsg</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set this to 1 to enable /dev/kmsg symlinking.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Mount points</title>
|
||||
<para>
|
||||
|
@ -1632,33 +1632,6 @@ static int lxc_setup_console(const struct lxc_rootfs *rootfs,
|
||||
return lxc_setup_ttydir_console(rootfs, console, ttydir);
|
||||
}
|
||||
|
||||
static int setup_kmsg(const struct lxc_rootfs *rootfs,
|
||||
const struct lxc_console *console)
|
||||
{
|
||||
char kpath[MAXPATHLEN];
|
||||
int ret;
|
||||
|
||||
if (!rootfs->path)
|
||||
return 0;
|
||||
ret = snprintf(kpath, sizeof(kpath), "%s/dev/kmsg", rootfs->mount);
|
||||
if (ret < 0 || ret >= sizeof(kpath))
|
||||
return -1;
|
||||
|
||||
ret = unlink(kpath);
|
||||
if (ret && errno != ENOENT) {
|
||||
SYSERROR("error unlinking %s", kpath);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = symlink("console", kpath);
|
||||
if (ret) {
|
||||
SYSERROR("failed to create symlink for kmsg");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void parse_mntopt(char *opt, unsigned long *flags, char **data)
|
||||
{
|
||||
struct mount_opt *mo;
|
||||
@ -2667,7 +2640,6 @@ struct lxc_conf *lxc_conf_init(void)
|
||||
free(new);
|
||||
return NULL;
|
||||
}
|
||||
new->kmsg = 0;
|
||||
new->logfd = -1;
|
||||
lxc_list_init(&new->cgroup);
|
||||
lxc_list_init(&new->network);
|
||||
@ -4206,11 +4178,6 @@ int lxc_setup(struct lxc_handler *handler)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (lxc_conf->kmsg) {
|
||||
if (setup_kmsg(&lxc_conf->rootfs, &lxc_conf->console)) // don't fail
|
||||
ERROR("failed to setup kmsg for '%s'", name);
|
||||
}
|
||||
|
||||
if (!lxc_conf->is_execute && setup_dev_symlinks(&lxc_conf->rootfs)) {
|
||||
ERROR("failed to setup /dev symlinks for '%s'", name);
|
||||
return -1;
|
||||
|
@ -351,7 +351,6 @@ struct lxc_conf {
|
||||
int haltsignal; // signal used to halt container
|
||||
int rebootsignal; // signal used to reboot container
|
||||
int stopsignal; // signal used to hard stop container
|
||||
unsigned int kmsg; // if 1, create /dev/kmsg symlink
|
||||
char *rcfile; // Copy of the top level rcfile we read
|
||||
|
||||
// Logfile and logleve can be set in a container config file.
|
||||
|
@ -87,12 +87,6 @@ static int get_config_ttydir(const char *, char *, int, struct lxc_conf *,
|
||||
void *);
|
||||
static int clr_config_ttydir(const char *, struct lxc_conf *, void *);
|
||||
|
||||
static int set_config_kmsg(const char *, const char *, struct lxc_conf *,
|
||||
void *);
|
||||
static int get_config_kmsg(const char *, char *, int, struct lxc_conf *,
|
||||
void *);
|
||||
static int clr_config_kmsg(const char *, struct lxc_conf *, void *);
|
||||
|
||||
static int set_config_apparmor_profile(const char *, const char *,
|
||||
struct lxc_conf *, void *);
|
||||
static int get_config_apparmor_profile(const char *, char *, int,
|
||||
@ -428,7 +422,6 @@ static struct lxc_config_t config[] = {
|
||||
{ "lxc.pts", set_config_pts, get_config_pts, clr_config_pts, },
|
||||
{ "lxc.tty", set_config_tty, get_config_tty, clr_config_tty, },
|
||||
{ "lxc.devttydir", set_config_ttydir, get_config_ttydir, clr_config_ttydir, },
|
||||
{ "lxc.kmsg", set_config_kmsg, get_config_kmsg, clr_config_kmsg, },
|
||||
{ "lxc.apparmor.profile", set_config_apparmor_profile, get_config_apparmor_profile, clr_config_apparmor_profile, },
|
||||
{ "lxc.apparmor.allow_incomplete", set_config_apparmor_allow_incomplete, get_config_apparmor_allow_incomplete, clr_config_apparmor_allow_incomplete, },
|
||||
{ "lxc.selinux.context", set_config_selinux_context, get_config_selinux_context, clr_config_selinux_context, },
|
||||
@ -1575,25 +1568,6 @@ static int set_config_ttydir(const char *key, const char *value,
|
||||
NAME_MAX + 1);
|
||||
}
|
||||
|
||||
static int set_config_kmsg(const char *key, const char *value,
|
||||
struct lxc_conf *lxc_conf, void *data)
|
||||
{
|
||||
/* Set config value to default. */
|
||||
if (lxc_config_value_empty(value)) {
|
||||
lxc_conf->kmsg = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Parse new config value. */
|
||||
if (lxc_safe_uint(value, &lxc_conf->kmsg) < 0)
|
||||
return -1;
|
||||
|
||||
if (lxc_conf->kmsg > 1)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_config_apparmor_profile(const char *key, const char *value,
|
||||
struct lxc_conf *lxc_conf, void *data)
|
||||
{
|
||||
@ -3106,12 +3080,6 @@ static int get_config_ttydir(const char *key, char *retv, int inlen,
|
||||
return lxc_get_conf_str(retv, inlen, c->ttydir);
|
||||
}
|
||||
|
||||
static int get_config_kmsg(const char *key, char *retv, int inlen,
|
||||
struct lxc_conf *c, void *data)
|
||||
{
|
||||
return lxc_get_conf_int(c, retv, inlen, c->kmsg);
|
||||
}
|
||||
|
||||
static int get_config_apparmor_profile(const char *key, char *retv, int inlen,
|
||||
struct lxc_conf *c, void *data)
|
||||
{
|
||||
@ -3694,13 +3662,6 @@ static inline int clr_config_ttydir(const char *key, struct lxc_conf *c,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int clr_config_kmsg(const char *key, struct lxc_conf *c,
|
||||
void *data)
|
||||
{
|
||||
c->kmsg = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int clr_config_apparmor_profile(const char *key,
|
||||
struct lxc_conf *c, void *data)
|
||||
{
|
||||
|
@ -321,13 +321,6 @@ int main(int argc, char *argv[])
|
||||
goto non_test_error;
|
||||
}
|
||||
|
||||
/* lxc.kmsg */
|
||||
if (set_get_compare_clear_save_load(c, "lxc.kmsg", "1", tmpf, true) <
|
||||
0) {
|
||||
lxc_error("%s\n", "lxc.kmsg");
|
||||
goto non_test_error;
|
||||
}
|
||||
|
||||
/* REMOVE IN LXC 3.0
|
||||
legacy security keys
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user