udevcontrol.c revision 726687ad48bdececed1e7e44387c50e009e28208
/*
* Copyright (C) 2005-2006 Kay Sievers <kay.sievers@vrfy.org>
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include <time.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include "udev.h"
#include "udevd.h"
static int sock = -1;
static int udev_log = 0;
{
static struct udevd_ctrl_msg ctrl_msg;
struct sockaddr_un saddr;
const char *env;
const char *arg;
const char *val;
int *intval;
int retval = 1;
if (env)
logging_init("udevcontrol");
if (argc < 2) {
goto exit;
}
/* allow instructions passed as options */
arg += 2;
char *endp;
int count;
goto exit;
}
char *endp;
int count;
goto exit;
}
else
goto exit;
}
printf("Usage: udevadm control COMMAND\n"
" --log_priority=<level> set the udev log level for the daemon\n"
" --stop_exec_queue keep udevd from executing events, queue only\n"
" --start_exec_queue execute events, flush queue\n"
" --reload_rules reloads the rules files\n"
" --env=<KEY>=<value> set a global environment variable\n"
" --max_childs=<N> maximum number of childs\n"
" --max_childs_running=<N> maximum number of childs running at the same time\n"
" --help print this help text\n\n");
goto exit;
} else {
goto exit;
}
if (getuid() != 0) {
goto exit;
}
if (sock == -1) {
goto exit;
}
/* use abstract namespace for socket path */
if (retval == -1) {
retval = 1;
} else {
retval = 0;
}
exit:
return retval;
}