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