patch systemd service with After=dbus.service to fix blocking shutdowns

remove sysv initscript [release 0.9.10.0-3mamba;Sat Nov 22 2014]
This commit is contained in:
Silvan Calarco 2024-01-05 17:49:44 +01:00
parent aa572dd0b8
commit 6b0091484e
4 changed files with 20 additions and 311 deletions

View File

@ -1,12 +0,0 @@
diff -Nru NetworkManager-0.8.2.orig//initscript/RedHat/NetworkManager NetworkManager-0.8.2/initscript/RedHat/NetworkManager
--- NetworkManager-0.8.2.orig//initscript/RedHat/NetworkManager.in 2010-11-03 21:11:32.000000000 +0100
+++ NetworkManager-0.8.2/initscript/RedHat/NetworkManager.in 2010-12-03 03:23:19.419087517 +0100
@@ -49,7 +49,7 @@
echo
echo -n $"Starting NetworkManager daemon: "
- daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile
+ daemon --pidfile=$pidfile --check $servicename $processname --pid-file=$pidfile
RETVAL=$?
echo
if [ -n "${NETWORKWAIT}" ]; then

View File

@ -0,0 +1,10 @@
--- NetworkManager-0.9.10.0/data/NetworkManager.service.in.orig 2014-11-22 15:00:54.227221107 +0100
+++ NetworkManager-0.9.10.0/data/NetworkManager.service.in 2014-11-22 15:01:03.284221718 +0100
@@ -2,6 +2,7 @@
Description=Network Manager
Wants=network.target
Before=network.target @DISTRO_NETWORK_SERVICE@
+After=dbus.service
[Service]
Type=dbus

View File

@ -1,287 +0,0 @@
Submitted By: Armin K. <krejzi at email dot com>
Date: 2012-06-03
Initial Package Version: 0.9.4.0
Upstream Status: In upstream SVN
Origin: Upstream
Description: libnm-glib: initialize GError, else invalid free() crash can occur (rh #809123)
libnm-glib: more ensure_inited() fixing
ppp: don't use struct ifpppstatsreq that was removed from linux/ip_ppp.h
diff -Naur NetworkManager.orig/libnm-glib/nm-access-point.c NetworkManager/libnm-glib/nm-access-point.c
--- NetworkManager.orig/libnm-glib/nm-access-point.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-access-point.c 2012-06-03 21:00:42.173840751 +0200
@@ -464,6 +464,8 @@
{
NMAccessPoint *ap = NM_ACCESS_POINT (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_FLAGS:
g_value_set_uint (value, nm_access_point_get_flags (ap));
diff -Naur NetworkManager.orig/libnm-glib/nm-active-connection.c NetworkManager/libnm-glib/nm-active-connection.c
--- NetworkManager.orig/libnm-glib/nm-active-connection.c 2012-03-12 22:25:57.000000000 +0100
+++ NetworkManager/libnm-glib/nm-active-connection.c 2012-06-03 21:00:42.174840767 +0200
@@ -394,6 +394,8 @@
{
NMActiveConnection *self = NM_ACTIVE_CONNECTION (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_CONNECTION:
g_value_set_string (value, nm_active_connection_get_connection (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-client.c NetworkManager/libnm-glib/nm-client.c
--- NetworkManager.orig/libnm-glib/nm-client.c 2012-03-21 18:29:52.000000000 +0100
+++ NetworkManager/libnm-glib/nm-client.c 2012-06-03 21:00:42.174840767 +0200
@@ -1502,6 +1502,8 @@
NMClient *self = NM_CLIENT (object);
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_VERSION:
g_value_set_string (value, nm_client_get_version (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-bond.c NetworkManager/libnm-glib/nm-device-bond.c
--- NetworkManager.orig/libnm-glib/nm-device-bond.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-bond.c 2012-06-03 21:00:42.174840767 +0200
@@ -241,6 +241,8 @@
{
NMDeviceBond *device = NM_DEVICE_BOND (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_bond_get_hw_address (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-bt.c NetworkManager/libnm-glib/nm-device-bt.c
--- NetworkManager.orig/libnm-glib/nm-device-bt.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-bt.c 2012-06-03 21:00:42.174840767 +0200
@@ -303,6 +303,8 @@
{
NMDeviceBt *device = NM_DEVICE_BT (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_bt_get_hw_address (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device.c NetworkManager/libnm-glib/nm-device.c
--- NetworkManager.orig/libnm-glib/nm-device.c 2012-03-23 21:54:25.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device.c 2012-06-03 21:00:42.175840783 +0200
@@ -313,6 +313,8 @@
NMDevice *device = NM_DEVICE (object);
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_DEVICE_TYPE:
g_value_set_uint (value, nm_device_get_device_type (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-ethernet.c NetworkManager/libnm-glib/nm-device-ethernet.c
--- NetworkManager.orig/libnm-glib/nm-device-ethernet.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-ethernet.c 2012-06-03 21:00:42.175840783 +0200
@@ -311,6 +311,8 @@
{
NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_ethernet_get_hw_address (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-infiniband.c NetworkManager/libnm-glib/nm-device-infiniband.c
--- NetworkManager.orig/libnm-glib/nm-device-infiniband.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-infiniband.c 2012-06-03 21:00:42.175840783 +0200
@@ -250,6 +250,8 @@
{
NMDeviceInfiniband *device = NM_DEVICE_INFINIBAND (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_infiniband_get_hw_address (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-modem.c NetworkManager/libnm-glib/nm-device-modem.c
--- NetworkManager.orig/libnm-glib/nm-device-modem.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-modem.c 2012-06-03 21:00:42.175840783 +0200
@@ -205,6 +205,8 @@
{
NMDeviceModem *self = NM_DEVICE_MODEM (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_MODEM_CAPS:
g_value_set_uint (value, nm_device_modem_get_modem_capabilities (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-olpc-mesh.c NetworkManager/libnm-glib/nm-device-olpc-mesh.c
--- NetworkManager.orig/libnm-glib/nm-device-olpc-mesh.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-olpc-mesh.c 2012-06-03 21:00:42.176840799 +0200
@@ -257,6 +257,8 @@
{
NMDeviceOlpcMesh *device = NM_DEVICE_OLPC_MESH (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_olpc_mesh_get_hw_address (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-vlan.c NetworkManager/libnm-glib/nm-device-vlan.c
--- NetworkManager.orig/libnm-glib/nm-device-vlan.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-vlan.c 2012-06-03 21:00:42.176840799 +0200
@@ -264,6 +264,8 @@
{
NMDeviceVlan *device = NM_DEVICE_VLAN (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_vlan_get_hw_address (device));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-wifi.c NetworkManager/libnm-glib/nm-device-wifi.c
--- NetworkManager.orig/libnm-glib/nm-device-wifi.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-wifi.c 2012-06-03 21:00:42.176840799 +0200
@@ -501,6 +501,8 @@
{
NMDeviceWifi *self = NM_DEVICE_WIFI (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_wifi_get_hw_address (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-device-wimax.c NetworkManager/libnm-glib/nm-device-wimax.c
--- NetworkManager.orig/libnm-glib/nm-device-wimax.c 2012-03-20 21:40:12.000000000 +0100
+++ NetworkManager/libnm-glib/nm-device-wimax.c 2012-06-03 21:00:42.176840799 +0200
@@ -444,6 +444,8 @@
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_HW_ADDRESS:
g_value_set_string (value, nm_device_wimax_get_hw_address (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-dhcp4-config.c NetworkManager/libnm-glib/nm-dhcp4-config.c
--- NetworkManager.orig/libnm-glib/nm-dhcp4-config.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-dhcp4-config.c 2012-06-03 21:00:42.176840799 +0200
@@ -132,6 +132,8 @@
{
NMDHCP4Config *self = NM_DHCP4_CONFIG (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_OPTIONS:
g_value_set_boxed (value, nm_dhcp4_config_get_options (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-dhcp6-config.c NetworkManager/libnm-glib/nm-dhcp6-config.c
--- NetworkManager.orig/libnm-glib/nm-dhcp6-config.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-dhcp6-config.c 2012-06-03 21:00:42.176840799 +0200
@@ -132,6 +132,8 @@
{
NMDHCP6Config *self = NM_DHCP6_CONFIG (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_OPTIONS:
g_value_set_boxed (value, nm_dhcp6_config_get_options (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-ip4-config.c NetworkManager/libnm-glib/nm-ip4-config.c
--- NetworkManager.orig/libnm-glib/nm-ip4-config.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-ip4-config.c 2012-06-03 21:00:42.177840815 +0200
@@ -187,6 +187,8 @@
NMIP4Config *self = NM_IP4_CONFIG (object);
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_ADDRESSES:
nm_utils_ip4_addresses_to_gvalue (priv->addresses, value);
diff -Naur NetworkManager.orig/libnm-glib/nm-ip6-config.c NetworkManager/libnm-glib/nm-ip6-config.c
--- NetworkManager.orig/libnm-glib/nm-ip6-config.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-ip6-config.c 2012-06-03 21:00:42.177840815 +0200
@@ -268,6 +268,8 @@
NMIP6Config *self = NM_IP6_CONFIG (object);
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_ADDRESSES:
nm_utils_ip6_addresses_to_gvalue (priv->addresses, value);
diff -Naur NetworkManager.orig/libnm-glib/nm-remote-settings.c NetworkManager/libnm-glib/nm-remote-settings.c
--- NetworkManager.orig/libnm-glib/nm-remote-settings.c 2012-03-21 18:31:38.000000000 +0100
+++ NetworkManager/libnm-glib/nm-remote-settings.c 2012-06-03 21:00:42.177840815 +0200
@@ -109,7 +109,7 @@
_nm_remote_settings_ensure_inited (NMRemoteSettings *self)
{
NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self);
- GError *error;
+ GError *error = NULL;
if (!priv->inited) {
if (!g_initable_init (G_INITABLE (self), NULL, &error)) {
@@ -1061,6 +1061,8 @@
{
NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object);
+ _nm_remote_settings_ensure_inited (NM_REMOTE_SETTINGS (object));
+
switch (prop_id) {
case PROP_BUS:
g_value_set_boxed (value, priv->bus);
diff -Naur NetworkManager.orig/libnm-glib/nm-vpn-connection.c NetworkManager/libnm-glib/nm-vpn-connection.c
--- NetworkManager.orig/libnm-glib/nm-vpn-connection.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-vpn-connection.c 2012-06-03 21:00:42.177840815 +0200
@@ -211,6 +211,8 @@
{
NMVPNConnection *self = NM_VPN_CONNECTION (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_VPN_STATE:
g_value_set_uint (value, nm_vpn_connection_get_vpn_state (self));
diff -Naur NetworkManager.orig/libnm-glib/nm-wimax-nsp.c NetworkManager/libnm-glib/nm-wimax-nsp.c
--- NetworkManager.orig/libnm-glib/nm-wimax-nsp.c 2012-02-27 16:57:16.000000000 +0100
+++ NetworkManager/libnm-glib/nm-wimax-nsp.c 2012-06-03 21:00:42.177840815 +0200
@@ -247,6 +247,8 @@
{
NMWimaxNsp *nsp = NM_WIMAX_NSP (object);
+ _nm_object_ensure_inited (NM_OBJECT (object));
+
switch (prop_id) {
case PROP_NAME:
g_value_set_string (value, nm_wimax_nsp_get_name (nsp));
diff -Naur NetworkManager.orig/src/ppp-manager/nm-ppp-manager.c NetworkManager/src/ppp-manager/nm-ppp-manager.c
--- NetworkManager.orig/src/ppp-manager/nm-ppp-manager.c 2012-03-20 22:13:41.000000000 +0100
+++ NetworkManager/src/ppp-manager/nm-ppp-manager.c 2012-06-03 21:01:35.545685909 +0200
@@ -304,18 +304,20 @@
{
NMPPPManager *manager = NM_PPP_MANAGER (user_data);
NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager);
- struct ifpppstatsreq req;
+ struct ifreq req;
+ struct ppp_stats stats;
memset (&req, 0, sizeof (req));
- req.stats_ptr = (caddr_t) &req.stats;
+ memset (&stats, 0, sizeof (stats));
+ req.ifr_data = (caddr_t) &stats;
- strncpy (req.ifr__name, priv->ip_iface, sizeof (req.ifr__name));
+ strncpy (req.ifr_name, priv->ip_iface, sizeof (req.ifr_name));
if (ioctl (priv->monitor_fd, SIOCGPPPSTATS, &req) < 0) {
nm_log_warn (LOGD_PPP, "could not read ppp stats: %s", strerror (errno));
} else {
g_signal_emit (manager, signals[STATS], 0,
- req.stats.p.ppp_ibytes,
- req.stats.p.ppp_obytes);
+ stats.p.ppp_ibytes,
+ stats.p.ppp_obytes);
}
return TRUE;

View File

@ -1,7 +1,7 @@
%define majver %(echo %version | cut -d. -f 1-2) %define majver %(echo %version | cut -d. -f 1-2)
Name: NetworkManager Name: NetworkManager
Version: 0.9.10.0 Version: 0.9.10.0
Release: 2mamba Release: 3mamba
Summary: A hardware level network management tool integrated with D-Bus Summary: A hardware level network management tool integrated with D-Bus
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Vendor: openmamba Vendor: openmamba
@ -10,11 +10,8 @@ Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://wiki.gnome.org/Projects/NetworkManager URL: https://wiki.gnome.org/Projects/NetworkManager
Source: http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/%{majver}/%{name}-%{version}.tar.xz Source: http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/%{majver}/%{name}-%{version}.tar.xz
Source1: NetworkManager-0.8.2-polkit-localauthority.patch Source1: NetworkManager-0.8.2-polkit-localauthority.patch
# From svn: Patch0: NetworkManager-0.9.10.0-stop-before-dbus.patch
# svn co svn://svn.gnome.org/svn/NetworkManager/trunk NetworkManager
Patch0: %{name}-0.8.2-initscript.patch
Patch7: %{name}-0.9.4.0-wpa_supplicant_longer_timeout.patch Patch7: %{name}-0.9.4.0-wpa_supplicant_longer_timeout.patch
Patch12: %{name}-0.9.4.0-upstream-fixes-2.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: ModemManager-devel BuildRequires: ModemManager-devel
@ -97,8 +94,6 @@ This package includes the %{name} API documentation.
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
#%patch7 -p1
#%patch12 -p1
%build %build
%configure \ %configure \
@ -132,7 +127,6 @@ rm -f %{buildroot}%{_libdir}/libnm-*.a
install -d -m0755 %{buildroot}%{_sysconfdir}/NetworkManager/VPN install -d -m0755 %{buildroot}%{_sysconfdir}/NetworkManager/VPN
install -d -m0755 %{buildroot}%{_sysconfdir}/NetworkManager/system-connections install -d -m0755 %{buildroot}%{_sysconfdir}/NetworkManager/system-connections
install -D -m0755 initscript/RedHat/NetworkManager %{buildroot}%{_initrddir}/NetworkManager
%{find_lang} %{name} %{find_lang} %{name}
@ -148,6 +142,8 @@ _EOF
%post %post
/sbin/ldconfig /sbin/ldconfig
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
# clean old sysv broken links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
sed -i "s|^plugins=keyfile$|plugins=ifcfg-rh,keyfile|" %{_sysconfdir}/NetworkManager/NetworkManager.conf sed -i "s|^plugins=keyfile$|plugins=ifcfg-rh,keyfile|" %{_sysconfdir}/NetworkManager/NetworkManager.conf
systemctl -q enable NetworkManager systemctl -q enable NetworkManager
systemctl -q enable NetworkManager-dispatcher systemctl -q enable NetworkManager-dispatcher
@ -155,10 +151,7 @@ if [ $1 -ge 1 ]; then
fi fi
if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
# new install # new install
systemctl -q enable NetworkManager
systemctl -q daemon-reload
systemctl -q start NetworkManager systemctl -q start NetworkManager
/sbin/chkconfig --add NetworkManager
fi fi
exit 0 exit 0
@ -166,8 +159,10 @@ exit 0
# erase # erase
/sbin/ldconfig /sbin/ldconfig
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
systemctl -q stop NetworkManager-dispatcher
systemctl -q stop NetworkManager systemctl -q stop NetworkManager
systemctl -q disable NetworkManager systemctl -q disable NetworkManager
systemctl -q disable NetworkManager-dispatcher
fi fi
exit 0 exit 0
@ -180,7 +175,6 @@ exit 0
%dir %{_sysconfdir}/NetworkManager/dispatcher.d %dir %{_sysconfdir}/NetworkManager/dispatcher.d
%dir %{_sysconfdir}/NetworkManager/VPN %dir %{_sysconfdir}/NetworkManager/VPN
%dir %{_sysconfdir}/NetworkManager/system-connections %dir %{_sysconfdir}/NetworkManager/system-connections
%{_initrddir}/NetworkManager
%{_sbindir}/NetworkManager %{_sbindir}/NetworkManager
%{_bindir}/nmcli %{_bindir}/nmcli
%{_bindir}/nmtui %{_bindir}/nmtui
@ -266,6 +260,10 @@ exit 0
%{_datadir}/doc/NetworkManager/examples/server.conf %{_datadir}/doc/NetworkManager/examples/server.conf
%changelog %changelog
* Sat Nov 22 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.10.0-3mamba
- patch systemd service with After=dbus.service to fix blocking shutdowns
- remove sysv initscript
* Thu Oct 16 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.10.0-2mamba * Thu Oct 16 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.10.0-2mamba
- rebuilt with --with-session-tracking=systemd and more new options - rebuilt with --with-session-tracking=systemd and more new options