resolved.c revision 4d506d6bb757af3b99e0876234c465e6898c5ea4
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani This file is part of systemd.
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani Copyright 2014 Tom Gundersen <teg@jklm.no>
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani systemd is free software; you can redistribute it and/or modify it
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani under the terms of the GNU Lesser General Public License as published by
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani the Free Software Foundation; either version 2.1 of the License, or
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani (at your option) any later version.
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani systemd is distributed in the hope that it will be useful, but
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani WITHOUT ANY WARRANTY; without even the implied warranty of
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani Lesser General Public License for more details.
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani You should have received a copy of the GNU Lesser General Public License
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani along with systemd; If not, see <http://www.gnu.org/licenses/>.
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani log_error("This program takes no arguments.");
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani log_error_errno(r, "SELinux setup failed: %m");
2212d76d08f3bc34c683aed1a6736325b841625cBeniamino Galvani r = get_user_creds(&user, &uid, &gid, NULL, NULL);
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani log_error_errno(r, "Cannot resolve user name %s: %m", user);
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani /* Always create the directory where resolv.conf will live */
176c355b43e616b61552566303ad59d5fd910333Beniamino Galvani r = mkdir_safe_label("/run/systemd/resolve", 0755, uid, gid);
2212d76d08f3bc34c683aed1a6736325b841625cBeniamino Galvani log_error_errno(r, "Could not create runtime directory: %m");
2212d76d08f3bc34c683aed1a6736325b841625cBeniamino Galvani assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, SIGUSR1, -1) >= 0);
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani log_error_errno(r, "Could not create manager: %m");
2212d76d08f3bc34c683aed1a6736325b841625cBeniamino Galvani log_warning_errno(r, "Failed to parse configuration file: %m");
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani log_error_errno(r, "Failed to start manager: %m");
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani /* Write finish default resolv.conf to avoid a dangling
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani log_warning_errno(r, "Could not create resolv.conf: %m");
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani "STATUS=Processing requests...");
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani "STOPPING=1\n"
ad1ad5c8e36ea795034fcdac660b15d7c141d55bSusant Sahani "STATUS=Shutting down...");