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