diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in
index 745ccd8a3..de3f5b5e2 100644
--- a/doc/lxc.container.conf.sgml.in
+++ b/doc/lxc.container.conf.sgml.in
@@ -791,25 +791,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
- Enable kmsg symlink
-
- Enable creating /dev/kmsg as symlink to /dev/console. This defaults to 0.
-
-
-
-
-
-
-
-
- Set this to 1 to enable /dev/kmsg symlinking.
-
-
-
-
-
-
Mount points
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 7ecfc82ec..c5281b056 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -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;
diff --git a/src/lxc/conf.h b/src/lxc/conf.h
index 495d6486f..24659b54b 100644
--- a/src/lxc/conf.h
+++ b/src/lxc/conf.h
@@ -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.
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index cfad6c5a8..fec1d5638 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -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)
{
diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c
index 6618596c6..3836a361c 100644
--- a/src/tests/parse_config_file.c
+++ b/src/tests/parse_config_file.c
@@ -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
*/