Magellan Linux

Contents of /trunk/networkmanager/NetworkManagerMagellan.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1153 - (show annotations) (download)
Mon Sep 27 20:15:14 2010 UTC (13 years, 7 months ago) by niro
File MIME type: text/plain
File size: 1961 byte(s)
-rebased against 0.8.1
1 /* NetworkManager -- Network link manager
2 *
3 * Backend implementation for the Magellan Linux distribution http://www.magellan-linux.de
4 *
5 * Niels Rogalla <niro@magellan-linux.de>
6 *
7 * Heavily based on NetworkManagerGentoo.c by Robert Paskowitz
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 *
23 * (C) Copyright 2004 Tom Parker
24 * (C) Copyright 2004 Matthew Garrett
25 * (C) Copyright 2004 Red Hat, Inc.
26 */
27
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31
32 #include <stdio.h>
33 #include <string.h>
34 #include <stdlib.h>
35
36 #include "NetworkManagerGeneric.h"
37 #include "nm-system.h"
38 #include "NetworkManagerUtils.h"
39 #include "nm-logging.h"
40
41 /*
42 * nm_system_enable_loopback
43 *
44 * Bring up the loopback interface
45 *
46 */
47 void nm_system_enable_loopback (void)
48 {
49 /* No need to run localnet if it is already running */
50 if (nm_spawn_process ("/etc/init.d/localnet status") != 0)
51 nm_spawn_process("/etc/init.d/localnet start");
52 }
53
54 /*
55 * nm_system_update_dns
56 *
57 * Make glibc/nscd aware of any changes to the resolv.conf file by
58 * restarting nscd. Only restart if already running.
59 *
60 */
61 void nm_system_update_dns (void)
62 {
63 if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
64 nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
65 nm_spawn_process ("/usr/sbin/nscd -i hosts");
66 }
67 }