[systemd-commits] 2 commits - man/systemd.service.xml src/core src/sysv-generator

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sun Nov 30 16:10:48 PST 2014


 man/systemd.service.xml               |   34 ----------------------------------
 src/core/load-fragment-gperf.gperf.m4 |   30 ++++++++++++++----------------
 src/core/load-fragment.c              |   19 ++++++++++++++++---
 src/core/load-fragment.h              |    6 ++++++
 src/core/service.c                    |    7 -------
 src/core/service.h                    |    3 ---
 src/sysv-generator/sysv-generator.c   |    3 ---
 7 files changed, 36 insertions(+), 66 deletions(-)

New commits:
commit 9e37c9544b22aab2173695ac9c0e4b8bb02cb75c
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Nov 30 10:42:53 2014 -0500

    core: warn and ignore SysVStartPriority=
    
    Option was being parsed but not used for anything.

diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index e563b19..6e81c54 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -1131,40 +1131,6 @@
         </refsect1>
 
         <refsect1>
-                <title>Compatibility Options</title>
-
-                <para>The following options are also available in the
-                <literal>[Service]</literal> section, but exist purely
-                for compatibility reasons and should not be used in
-                newly written service files.</para>
-
-                <variablelist class='unit-directives'>
-                        <varlistentry>
-                                <term><varname>SysVStartPriority=</varname></term>
-                                <listitem><para>Set the SysV start
-                                priority to use to order this service
-                                in relation to SysV services lacking
-                                LSB headers. This option is only
-                                necessary to fix ordering in relation
-                                to legacy SysV services that have no
-                                ordering information encoded in the
-                                script headers. As such, it should only
-                                be used as a temporary compatibility
-                                option and should not be used in new unit
-                                files. Almost always, it is a better
-                                choice to add explicit ordering
-                                directives via
-                                <varname>After=</varname> or
-                                <varname>Before=</varname>,
-                                instead. For more details, see
-                                <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
-                                If used, pass an integer value in the
-                                range 0-99.</para></listitem>
-                        </varlistentry>
-                </variablelist>
-        </refsect1>
-
-        <refsect1>
                 <title>Command lines</title>
 
                 <para>This section describes command line parsing and
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index b5a8e31..e0ffaa6 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -223,9 +223,7 @@ Service.GuessMainPID,            config_parse_bool,                  0,
 Service.RestartPreventExitStatus, config_parse_set_status,           0,                             offsetof(Service, restart_prevent_status)
 Service.RestartForceExitStatus,  config_parse_set_status,            0,                             offsetof(Service, restart_force_status)
 Service.SuccessExitStatus,       config_parse_set_status,            0,                             offsetof(Service, success_status)
-m4_ifdef(`HAVE_SYSV_COMPAT',
-`Service.SysVStartPriority,      config_parse_sysv_priority,         0,                             offsetof(Service, sysv_start_priority)',
-`Service.SysVStartPriority,      config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
+Service.SysVStartPriority,       config_parse_warn_compat,           DISABLED_LEGACY,               0
 Service.NonBlocking,             config_parse_bool,                  0,                             offsetof(Service, exec_context.non_blocking)
 Service.BusName,                 config_parse_unit_string_printf,    0,                             offsetof(Service, bus_name)
 Service.NotifyAccess,            config_parse_notify_access,         0,                             offsetof(Service, notify_access)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 786737d..d385968 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -83,6 +83,10 @@ int config_parse_warn_compat(
                 log_syntax(unit, LOG_DEBUG, filename, line, EINVAL,
                            "Support for option %s= has been disabled at compile time and it is ignored", lvalue);
                 break;
+        case DISABLED_LEGACY:
+                log_syntax(unit, LOG_INFO, filename, line, EINVAL,
+                           "Support for option %s= has been removed and it is ignored", lvalue);
+                break;
         case DISABLED_EXPERIMENTAL:
                 log_syntax(unit, LOG_INFO, filename, line, EINVAL,
                            "Support for option %s= has not yet been enabled and it is ignored", lvalue);
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
index 4756830..21e0871 100644
--- a/src/core/load-fragment.h
+++ b/src/core/load-fragment.h
@@ -110,5 +110,6 @@ extern const char load_fragment_gperf_nulstr[];
 
 typedef enum Disabled {
         DISABLED_CONFIGURATION,
+        DISABLED_LEGACY,
         DISABLED_EXPERIMENTAL,
 } Disabled;
diff --git a/src/core/service.c b/src/core/service.c
index 9db773b..53a2935 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -546,13 +546,6 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) {
                 exec_command_dump_list(s->exec_command[c], f, prefix2);
         }
 
-#ifdef HAVE_SYSV_COMPAT
-        if (s->sysv_start_priority >= 0)
-                fprintf(f,
-                        "%sSysVStartPriority: %i\n",
-                        prefix, s->sysv_start_priority);
-#endif
-
         if (s->status_text)
                 fprintf(f, "%sStatus Text: %s\n",
                         prefix, s->status_text);
diff --git a/src/core/service.h b/src/core/service.h
index 54fbe46..f6a78c4 100644
--- a/src/core/service.h
+++ b/src/core/service.h
@@ -180,9 +180,6 @@ struct Service {
         bool bus_name_good:1;
         bool forbid_restart:1;
         bool start_timeout_defined:1;
-#ifdef HAVE_SYSV_COMPAT
-        int sysv_start_priority;
-#endif
 
         char *bus_name;
 
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index e6eef31..45c8b4e 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -174,9 +174,6 @@ static int generate_unit_file(SysvStub *s) {
                 "RemainAfterExit=%s\n",
                 yes_no(!s->pid_file));
 
-        if (s->sysv_start_priority > 0)
-                fprintf(f, "SysVStartPriority=%d\n", s->sysv_start_priority);
-
         if (s->pid_file)
                 fprintf(f, "PIDFile=%s\n", s->pid_file);
 

commit a2c0e528b8b5ba370527db279605e4e4135689c1
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Nov 30 10:21:49 2014 -0500

    When warning about unsupported options, be more detailed

diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index a94b805..b5a8e31 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -54,10 +54,10 @@ m4_ifdef(`HAVE_SECCOMP',
 $1.SystemCallArchitectures,      config_parse_syscall_archs,         0,                             offsetof($1, exec_context.syscall_archs)
 $1.SystemCallErrorNumber,        config_parse_syscall_errno,         0,                             offsetof($1, exec_context)
 $1.RestrictAddressFamilies,      config_parse_address_families,      0,                             offsetof($1, exec_context)',
-`$1.SystemCallFilter,            config_parse_warn_compat,           0,                             0
-$1.SystemCallArchitectures,      config_parse_warn_compat,           0,                             0
-$1.SystemCallErrorNumber,        config_parse_warn_compat,           0,                             0
-$1.RestrictAddressFamilies,      config_parse_warn_compat,           0,                             0')
+`$1.SystemCallFilter,            config_parse_warn_compat,           DISABLED_CONFIGURATION,        0
+$1.SystemCallArchitectures,      config_parse_warn_compat,           DISABLED_CONFIGURATION,        0
+$1.SystemCallErrorNumber,        config_parse_warn_compat,           DISABLED_CONFIGURATION,        0
+$1.RestrictAddressFamilies,      config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 $1.LimitCPU,                     config_parse_limit,                 RLIMIT_CPU,                    offsetof($1, exec_context.rlimit)
 $1.LimitFSIZE,                   config_parse_limit,                 RLIMIT_FSIZE,                  offsetof($1, exec_context.rlimit)
 $1.LimitDATA,                    config_parse_limit,                 RLIMIT_DATA,                   offsetof($1, exec_context.rlimit)
@@ -88,18 +88,18 @@ $1.RuntimeDirectoryMode,         config_parse_mode,                  0,
 $1.RuntimeDirectory,             config_parse_runtime_directory,     0,                             offsetof($1, exec_context.runtime_directory)
 m4_ifdef(`HAVE_PAM',
 `$1.PAMName,                     config_parse_unit_string_printf,    0,                             offsetof($1, exec_context.pam_name)',
-`$1.PAMName,                     config_parse_warn_compat,           0,                             0')
+`$1.PAMName,                     config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 $1.IgnoreSIGPIPE,                config_parse_bool,                  0,                             offsetof($1, exec_context.ignore_sigpipe)
 $1.UtmpIdentifier,               config_parse_unit_string_printf,    0,                             offsetof($1, exec_context.utmp_id)
 m4_ifdef(`HAVE_SELINUX',
 `$1.SELinuxContext,              config_parse_exec_selinux_context,  0,                             offsetof($1, exec_context)',
-`$1.SELinuxContext,              config_parse_warn_compat,           0,                             0')
+`$1.SELinuxContext,              config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 m4_ifdef(`HAVE_APPARMOR',
 `$1.AppArmorProfile,             config_parse_exec_apparmor_profile, 0,                             offsetof($1, exec_context)',
-`$1.AppArmorProfile,             config_parse_warn_compat,           0,                             0')
+`$1.AppArmorProfile,             config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 m4_ifdef(`HAVE_SMACK',
 `$1.SmackProcessLabel,           config_parse_exec_smack_process_label, 0,                          offsetof($1, exec_context)',
-`$1.SmackProcessLabel,           config_parse_warn_compat,           0,                             0')'
+`$1.SmackProcessLabel,           config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')'
 )m4_dnl
 m4_define(`KILL_CONTEXT_CONFIG_ITEMS',
 `$1.SendSIGKILL,                 config_parse_bool,                  0,                             offsetof($1, kill_context.send_sigkill)
@@ -225,14 +225,14 @@ Service.RestartForceExitStatus,  config_parse_set_status,            0,
 Service.SuccessExitStatus,       config_parse_set_status,            0,                             offsetof(Service, success_status)
 m4_ifdef(`HAVE_SYSV_COMPAT',
 `Service.SysVStartPriority,      config_parse_sysv_priority,         0,                             offsetof(Service, sysv_start_priority)',
-`Service.SysVStartPriority,      config_parse_warn_compat,           0,                             0')
+`Service.SysVStartPriority,      config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 Service.NonBlocking,             config_parse_bool,                  0,                             offsetof(Service, exec_context.non_blocking)
 Service.BusName,                 config_parse_unit_string_printf,    0,                             offsetof(Service, bus_name)
 Service.NotifyAccess,            config_parse_notify_access,         0,                             offsetof(Service, notify_access)
 Service.Sockets,                 config_parse_service_sockets,       0,                             0
 m4_ifdef(`ENABLE_KDBUS',
 `Service.BusPolicy,              config_parse_bus_endpoint_policy,   0,                             offsetof(Service, exec_context)',
-`Service.BusPolicy,              config_parse_warn_compat,           0,                             0')
+`Service.BusPolicy,              config_parse_warn_compat,           DISABLED_EXPERIMENTAL,         0')
 EXEC_CONTEXT_CONFIG_ITEMS(Service)m4_dnl
 CGROUP_CONTEXT_CONFIG_ITEMS(Service)m4_dnl
 KILL_CONTEXT_CONFIG_ITEMS(Service)m4_dnl
@@ -287,12 +287,12 @@ m4_ifdef(`HAVE_SMACK',
 `Socket.SmackLabel,              config_parse_string,                0,                             offsetof(Socket, smack)
 Socket.SmackLabelIPIn,           config_parse_string,                0,                             offsetof(Socket, smack_ip_in)
 Socket.SmackLabelIPOut,          config_parse_string,                0,                             offsetof(Socket, smack_ip_out)',
-`Socket.SmackLabel,              config_parse_warn_compat,           0,                             0
-Socket.SmackLabelIPIn,           config_parse_warn_compat,           0,                             0
-Socket.SmackLabelIPOut,          config_parse_warn_compat,           0,                             0')
+`Socket.SmackLabel,              config_parse_warn_compat,           DISABLED_CONFIGURATION,        0
+Socket.SmackLabelIPIn,           config_parse_warn_compat,           DISABLED_CONFIGURATION,        0
+Socket.SmackLabelIPOut,          config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 m4_ifdef(`HAVE_SELINUX',
 `Socket.SELinuxContextFromNet,   config_parse_bool,                  0,                             offsetof(Socket, selinux_context_from_net)',
-`Socket.SELinuxContextFromNet,   config_parse_warn_compat,           0,                             0')
+`Socket.SELinuxContextFromNet,   config_parse_warn_compat,           DISABLED_CONFIGURATION,        0')
 EXEC_CONTEXT_CONFIG_ITEMS(Socket)m4_dnl
 CGROUP_CONTEXT_CONFIG_ITEMS(Socket)m4_dnl
 KILL_CONTEXT_CONFIG_ITEMS(Socket)m4_dnl
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 64f7fa6..786737d 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -76,10 +76,19 @@ int config_parse_warn_compat(
                 const char *rvalue,
                 void *data,
                 void *userdata) {
+        Disabled reason = ltype;
+
+        switch(reason) {
+        case DISABLED_CONFIGURATION:
+                log_syntax(unit, LOG_DEBUG, filename, line, EINVAL,
+                           "Support for option %s= has been disabled at compile time and it is ignored", lvalue);
+                break;
+        case DISABLED_EXPERIMENTAL:
+                log_syntax(unit, LOG_INFO, filename, line, EINVAL,
+                           "Support for option %s= has not yet been enabled and it is ignored", lvalue);
+                break;
+        };
 
-        log_syntax(unit, LOG_DEBUG, filename, line, EINVAL,
-                   "Support for option %s= has been disabled at compile time and is ignored",
-                   lvalue);
         return 0;
 }
 #endif
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
index a799c9a..4756830 100644
--- a/src/core/load-fragment.h
+++ b/src/core/load-fragment.h
@@ -107,3 +107,8 @@ int config_parse_protect_system(const char* unit, const char *filename, unsigned
 /* gperf prototypes */
 const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length);
 extern const char load_fragment_gperf_nulstr[];
+
+typedef enum Disabled {
+        DISABLED_CONFIGURATION,
+        DISABLED_EXPERIMENTAL,
+} Disabled;



More information about the systemd-commits mailing list