Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 256446 Details for
Bug 318365
systemd - Replacement for sysvinit with extensive usage of parallelization
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
networkmanager-0.8.2-openrc-and-systemd.patch
networkmanager-0.8.2-openrc-and-systemd.patch (text/plain), 2.05 KB, created by
Canek Peláez Valdés
on 2010-12-05 23:17:30 UTC
(
hide
)
Description:
networkmanager-0.8.2-openrc-and-systemd.patch
Filename:
MIME Type:
Creator:
Canek Peláez Valdés
Created:
2010-12-05 23:17:30 UTC
Size:
2.05 KB
patch
obsolete
>diff -burN NetworkManager-0.8.2/src/backends/NetworkManagerGentoo.c NetworkManager-0.8.2.systemd/src/backends/NetworkManagerGentoo.c >--- NetworkManager-0.8.2/src/backends/NetworkManagerGentoo.c 2010-10-07 14:09:52.000000000 -0500 >+++ NetworkManager-0.8.2.systemd/src/backends/NetworkManagerGentoo.c 2010-12-05 15:00:02.000000000 -0600 >@@ -30,12 +30,22 @@ > #include <stdio.h> > #include <string.h> > #include <stdlib.h> >+#include <gio/gio.h> > > #include "NetworkManagerGeneric.h" > #include "nm-system.h" > #include "NetworkManagerUtils.h" > #include "nm-logging.h" > >+#define BUFFER_SIZE 512 >+ >+static void openrc_start_lo_if_necessary() >+{ >+ /* No need to run net.lo if it is already running */ >+ if (nm_spawn_process ("/etc/init.d/net.lo status") != 0) >+ nm_spawn_process ("/etc/init.d/net.lo start"); >+} >+ > /* > * nm_system_enable_loopback > * >@@ -44,9 +54,42 @@ > */ > void nm_system_enable_loopback (void) > { >- /* No need to run net.lo if it is already running */ >- if (nm_spawn_process ("/etc/init.d/net.lo status") != 0) >- nm_spawn_process("/etc/init.d/net.lo start"); >+ GFile *file; >+ GFileInputStream *in; >+ gchar buffer[BUFFER_SIZE]; >+ gchar *comm, *readed, *tmp; >+ gssize r; >+ >+ file = g_file_new_for_path ("/proc/1/comm"); >+ in = g_file_read (file, NULL, NULL); >+ >+ /* If anything goes wrong trying to open /proc/1/comm, >+ we will assume OpenRC. */ >+ if (!in) { >+ openrc_start_lo_if_necessary (); >+ return; >+ } >+ >+ comm = g_strdup(""); >+ while ((r = g_input_stream_read (G_INPUT_STREAM(in), buffer, BUFFER_SIZE, NULL, NULL)) > 0) { >+ readed = g_strndup (buffer, r); >+ tmp = g_strconcat (comm, readed, NULL); >+ g_free (comm); >+ g_free (readed); >+ comm = tmp; >+ } >+ >+ if (g_strstr_len (comm, -1, "systemd")) { >+ /* We use the generic loopback enabler if using systemd. */ >+ nm_log_info (LOGD_CORE, "NetworkManager is running with systemd..."); >+ nm_generic_enable_loopback (); >+ } else { >+ /* OpenRC otherwise. */ >+ nm_log_info (LOGD_CORE, "NetworkManager is running with OpenRC..."); >+ openrc_start_lo_if_necessary(); >+ } >+ >+ g_free (comm); > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 318365
:
230771
|
230773
|
230777
|
230779
|
230887
|
230889
|
231157
|
231305
|
238431
|
241097
|
241099
|
244953
|
244955
|
244957
|
244959
|
256198
|
256199
|
256201
|
256202
|
256203
|
256205
|
256209
|
256319
|
256349
|
256351
|
256352
|
256435
|
256437
|
256439
|
256446
|
256698
|
257917
|
257922
|
270185
|
270187
|
270189
|
270191
|
271583
|
277115
|
277117
|
306293
|
306295
|
306297
|
306299
|
306339
|
306341
|
306343
|
306345