summaryrefslogtreecommitdiff
path: root/init
AgeCommit message (Collapse)Author
2018-03-05Fix warningsSamuel Thibault
* libdiskfs/boot-start.c (diskfs_start_bootstrap): Fix printf format. * libfshelp/delegate.c: Include <alloca.h> and <stdlib.h>. * libfshelp/start-translator-long.c: Include <stdlib.h>. * libshouldbeinlibc/ugids-verify-auth.c (server_verify_make_auth): Fix prototypes for password_check_group and password_check_user. * libstore/argp.c: Include <stdlib.h>. * libstore/task.c: Include <stdlib.h>. * exec/exec.c: Include <mach/vm_param.h>. * libbpf/bpf_impl.c: Include <stdlib.h>. * proc/info.c (S_proc_getloginpids): Remove local variables leader_task and leader_sub. * proc/main.c (main): Remove local variable original_argv. * boot/boot.c (task_died, S_mach_notify_new_task): Fix printf format. * exec/elfcore.c: Include <alloca.h> and <mach/vm_param.h>. * trans/crash.c: Include <hurd/msg.h>. * trans/random.c: Include <signal.h>. * utils/login.c: Include <signal.h>. * utils/id.c: Include <hurd/msg.h>. * utils/devprobe.c: Include <stdlib.h>. * utils/addauth.c: Include <hurd/msg.h>. * utils/frobauth-mod.c: Include <hurd/msg.h>. * utils/storeread.c: Include <stdlib.h>. * utils/msgport.c: Include <hurd/msg.h>. * sutils/clookup.c (file_name_lookup_carefully): Fix lookup function prototype, make head and tail const. * utils/rpcscan.c: Include <stdlib.h>. * sutils/bless.c: Include <stdlib.h>. * fstests/fstests.c: Include <stdlib.h>. * startup/startup.c (argz_task_insert_right): Fix printf format. * init/init.c: Include <stdlib.h>.
2016-09-04Fix patch to runsystem.hurdSamuel Thibault
* init/init.c (main): Run /libexec/runsystem.hurd instead of /etc/hurd/runsystem.hurd.
2015-08-08Print which path init tried to execvSamuel Thibault
* init/init.c (main): On execv failure, print which path failed.
2014-11-21init: add a minimalist init programJustus Winter
This patch adds a minimalist init program. It is somewhat lacking in features, but is able to bring up a Hurd system with the runsystem and rc scripts. In fact, it roughly does what the former /hurd/init did, modulo all the very early bootstrapping stuff and the startup protocol. It is started when all the essential servers are up and running, so it can make use of most of the POSIX goodies, making its implementation much simpler. * Makefile (prog-subdirs): Add init. * daemons/runsystem.sh: Generalize runsystem so that it can start any init as specified on the kernel command line. By default, it starts /hurd/init. * daemons/runsystem.hurd: This is a verbatim copy of runsystem.sh. It is started by /hurd/init. * daemons/rc.sh: Do not start /hurd/mach-defpager as it is already started in runsystem.sh. * daemons/Makefile (SRCS): Add runsystem.hurd. * init/Makefile: New file. * init/init.c: Likewise.
2014-11-21startup: rename /hurd/init to /hurd/startupJustus Winter
This patch series splits /hurd/init into two programs. As a first step, this patch renames /hurd/init to /hurd/startup. It is called startup because it speaks the startup protocol. * startup: Rename init to startup. Adjust accordingly. * Makefile (prog-subdirs): Likewise. * doc/hurd.texi (Server Bootstrap): Likewise. * hurd/paths.h (_HURD_STARTUP): Likewise. * libdiskfs/boot-start.c (diskfs_boot_init_program): Likewise. * libdiskfs/opts-std-startup.c (startup_options): Likewise.
2014-11-21Add proc_set_init_task, make runsystem pid 1Justus Winter
* hurd/process.defs (proc_set_init_task): New procedure. * hurd/process_reply.defs (proc_set_init_task): Likewise. * hurd/process_request.defs (proc_set_init_task): Likewise. * include/pids.h: Add HURD_PID_INIT as 1, adjust others accordingly. * init/init.c (start_child): Register the child task. * proc/proc.h (init_proc): New variable. (create_startup_proc): Rename to create_init_proc. * proc/main.c (main): Create placeholder proc object for pid 1. * proc/mgt.c: Use init_proc instead of startup_proc, as the former is the new root of the process tree. (create_startup_proc): Rename to create_init_proc. (S_proc_set_init_task): New function. * doc/hurd.texi (Server Bootstrap): Update accordingly. * procfs/main.c: Do not hard-code kernel pid, use pids.h instead.
2013-11-28init: fix port leakJustus Winter
* init/init.c (S_startup_essential_task): Fix port leak.
2013-11-09init: fix memory leakJustus Winter
Found using the Clang Static Analyzer. * init/init.c (process_signal): Fix memory leak.
2013-08-29init: Mark all of inits children and init itself as importantJustus Winter
This is based on a fragment of Guillem Jovers patch presented here: http://lists.gnu.org/archive/html/bug-hurd/2006-02/msg00081.html It has been refreshed, updated and the copyright year is adjusted properly. It has been complemented with the necessary features to address the issues the original patch set out to address, namely that killall5 freezes the proc translator before it tries to walk over /proc/*/stat to decide which process to kill. Prior to this patch (and the one marking the procfs server as important process), killall5 would deadlock trying to walk over the proc file system. Ironically it would not have killed any process later on even if it had the chance, since two values obtained from /proc/*/stat are currently hardcoded to zero in our procfs. Patches addressing the problem as a whole are prepared and will be sent as a follow up. * init/init.c (launch_core_servers): Mark init, auth, proc and fs servers as important. (start_child): Mark the real init as important. (S_startup_important_task): Mark exec server as important.
2013-08-28Define and use symbolic names for important processesJustus Winter
* include/pids.h: New file. * init/init.c (frob_kernel_process): Use symbolic name for kernel process. * exec/exec.c (S_exec_init): Use symbolic name for startup process. * libdiskfs/boot-start.c (diskfs_S_fsys_init): Likewise. * libdiskfs/init-startup.c (_diskfs_init_completed): Likewise. * pfinet/main.c (arrange_shutdown_notification): Likewise. * proc/mgt.c (create_startup_proc): Likewise. * proc/main.c (main): Use symbolic name for proc process.
2013-06-01Fix invalid memory accessMiguel Figueiredo
* init/init.c (start_child): Don't free `arg' before it is used.
2012-09-22Check that runsystem script exists before trying it.Samuel Thibault
* init/init.c (launch_something): Check with file_name_lookup that runsystem script exists before calling start_child. * daemons/console-run.c (main): Check with file_name_lookup that runsystem script exists before opening a console for it.
2010-08-02Partially revert 8451b436 to fix halt/rebootSamuel Thibault
init/init.c (S_msg_sig_post_untraced): Ignore result of msg_sig_post_untraced_reply. (S_msg_sig_post): Likewise.
2009-12-20Fix port leak when directly calling MIG stubsSamuel Thibault
* auth/auth.c (S_auth_server_authenticate): Check result of auth_server_authenticate_reply stub. * init/init.c (S_msg_sig_post_untraced): Check result of msg_sig_post_untraced_reply (S_msg_sig_post): Check result of msg_sig_post_reply.
2009-07-11Switch to the new ChangeLog style.Thomas Schwinge
* ChangeLog: Wipe out content, and add instructions about how to get it back. * auth/ChangeLog: Remove file. * benchmarks/ChangeLog: Likewise. * boot/ChangeLog: Likewise. * bsdfsck/ChangeLog: Likewise. * config/ChangeLog: Likewise. * console-client/ChangeLog: Likewise. * console/ChangeLog: Likewise. * daemons/ChangeLog: Likewise. * defpager/ChangeLog: Likewise. * doc/ChangeLog: Likewise. * exec/ChangeLog: Likewise. * ext2fs/ChangeLog: Likewise. * fatfs/ChangeLog: Likewise. * fstests/ChangeLog: Likewise. * ftpfs/ChangeLog: Likewise. * hostmux/ChangeLog: Likewise. * hurd/ChangeLog: Likewise. * include/ChangeLog: Likewise. * init/ChangeLog: Likewise. * isofs/ChangeLog: Likewise. * libcons/ChangeLog: Likewise. * libdirmgt/ChangeLog: Likewise. * libdiskfs/ChangeLog: Likewise. * libfshelp/ChangeLog: Likewise. * libftpconn/ChangeLog: Likewise. * libhurdbugaddr/ChangeLog: Likewise. * libihash/ChangeLog: Likewise. * libiohelp/ChangeLog: Likewise. * libnetfs/ChangeLog: Likewise. * libpager/ChangeLog: Likewise. * libpipe/ChangeLog: Likewise. * libports/ChangeLog: Likewise. * libps/ChangeLog: Likewise. * libshouldbeinlibc/ChangeLog: Likewise. * libstore/ChangeLog: Likewise. * libthreads/ChangeLog: Likewise. * libtrivfs/ChangeLog: Likewise. * login/ChangeLog: Likewise. * mach-defpager/ChangeLog: Likewise. * nfs/ChangeLog: Likewise. * nfsd/ChangeLog: Likewise. * pfinet/ChangeLog: Likewise. * pflocal/ChangeLog: Likewise. * proc/ChangeLog: Likewise. * release/ChangeLog: Likewise. * serverboot/ChangeLog: Likewise. * storeio/ChangeLog: Likewise. * sutils/ChangeLog: Likewise. * term/ChangeLog: Likewise. * tmpfs/ChangeLog: Likewise. * trans/ChangeLog: Likewise. * ufs-fsck/ChangeLog: Likewise. * ufs-utils/ChangeLog: Likewise. * ufs/ChangeLog: Likewise. * usermux/ChangeLog: Likewise. * utils/ChangeLog: Likewise.
2008-07-01Update copyright years.Thomas Schwinge
2008-03-16 * init.c (reboot_system): Initialize noise_len.Samuel Thibault
2006-02-04Correct ChangeLog format and add copyright year 2005.Thomas Schwinge
2005-02-242005-02-24 Ben Asselstine <benasselstine@gmail.com>Marcus Brinkmann
* init.c (main): Only pass ARGP_NO_ERRS to argp_parse when invoked by the bootstrap filesystem. (flags): New variable.
2002-05-08.Roland McGrath
2002-05-082002-05-07 Roland McGrath <roland@frob.com>Roland McGrath
* init.c (reboot_system): u_int -> size_t (reboot_system): Likewise. (S_msg_report_wait): int -> mach_msg_id_t
2002-03-26*** empty log message ***Neal H. Walfield
2002-03-262002-03-23 James A. Morrison <ja2morri@uwaterloo.ca>Neal H. Walfield
* init.c (reboot_mach): Use ERR, not errno. (run): Likewise. (lauch_core_servers): Likewise. (run_for_real): Use MACH_PORT_NULL explicitly. (start_child): Likewise.
2002-01-02.Roland McGrath
2002-01-022002-01-02 Roland McGrath <roland@frob.com>Roland McGrath
* init.c [KERN_INVALID_LEDGER]: Pass extra arguments to task_create for OSF variant.
2001-08-24.Roland McGrath
2001-08-242001-08-23 Roland McGrath <roland@frob.com>Roland McGrath
* init.c (main): Pass ARGP_NO_ERRS|ARGP_IN_ORDER to argp_parse.
2001-08-202001-08-20 Roland McGrath <roland@frob.com>Roland McGrath
* init.c [! SPLIT_INIT]: All this code removed. [SPLIT_INIT]: This code no longer conditional. (_PATH_RUNCOM, mapped_time, do_fastboot): Removed. * Makefile (split-init): Variable removed. (SRCS): Add stubs.c here unconditionally. [$(split-init) = no]: Conditional defns removed. (LCLHDRS): Variable removed. * ttys.c, ttys.h: Files removed.
2001-08-202001-08-20 Roland McGrath <roland@frob.com>Roland McGrath
* init.c [! SPLIT_INIT]: All this code removed. [SPLIT_INIT]: This code no longer conditional. (_PATH_RUNCOM, mapped_time, do_fastboot): Removed. * Makefile (split-init): Variable removed. (SRCS): Add stubs.c here unconditionally. [$(split-init) = no]: Conditional defns removed. (LCLHDRS): Variable removed. * ttys.c, ttys.h: Files removed.
2001-08-20.Roland McGrath
2001-08-202001-08-20 Roland McGrath <roland@frob.com>Roland McGrath
* init.c (kernel_command_line): Variable removed. (options, parse_opt): Remove -K option. (frob_kernel_process): Collect arguments from &global_argv[1] instead of slicing up kernel_command_line. (start_child): Take a second arg, if non-null more arguments for PROG. (launch_something): Change caller. On first try, pass &global_argv[1].
2001-07-02.Roland McGrath
2001-07-022001-07-02 Roland McGrath <roland@frob.com>Roland McGrath
* init.c (reboot_system): Don't pass null pointer to RPC out param. Thanks to Moritz Schulte <moritz@chaosdorf.de> for finding this.
2001-01-30daemons/Marcus Brinkmann
2001-01-17 Neal H Walfield <neal@cs.uml.edu> * console-run.c (open_console): Conform to new fshelp_start_translator semantics. init/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * init.c (open_console): Conform to new fshelp_start_translator semantics. libfshelp/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * fshelp.h: Add two new parameters to fshelp_open_fn_t: a port to the new task and a cookie. Add a new parameter, cookie, to fshelp_start_translator and fshelp_start_translator_long that will be passed to fshelp_open_fn_t. * fetch-root.c (fshelp_fetch_root): Conform to new fshelp_start_translator_long semantics. * start-translator-long.c (service_fsys_startup): Likewise. (fshelp_start_translator_long): Likewise. * start-translator.c (fshelp_start_translator): Likewise. libtreefs/ Conform to new fshelp_start_translator semantics. trans/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * pump.c (start_pfinet): Conform to new fshelp_start_translator semantics. utils/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * mount.c (do_mount): Conform to new fshelp_start_translator semantics. * settrans.c (main): Conform to new fshelp_start_translator semantics therby allowing us to print the pid of the an active translator.
2001-01-072000-12-21 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* init.c (process_rc_script): If malloc fails, return ENOMEM. Reported by Igor Khavkine <i_khavki@alcor.concordia.ca>.
2000-03-172000-03-17 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* init.c (launch_core_servers): Don't use MOVE_SEND in Hurd RPCs.
2000-03-14.Roland McGrath
2000-03-142000-03-13 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* stubs.c (send_signal): Don't use mach_msg_destroy, since it wants the local/remote ports reversed. Destroy the rights by hand instead.
2000-03-13.Roland McGrath
2000-03-132000-03-13 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* stubs.c (send_signal): Make MESSAGE auto instead of static. Take new argument TIMEOUT, passed to mach_msg instead of zero. (send_signal): For MACH_SEND_TIMED_OUT failure, destroy the pseudo-received message to avoid leaking send rights. * init.c (process_signal): Pass new argument, timeout of 500 ms.
1999-10-021999-09-28 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* init.c (frob_kernel_process): Allocate the kernel's page in the actual kernel task, not in our own. I wonder how this ever worked. Also if we fail in that allocation, free the page we allocated in our own space.
1999-09-05.Roland McGrath
1999-09-051999-08-24 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* init.c (notify_shutdown): Add const to argument type.
1999-07-24.Roland McGrath
1999-07-241999-07-24 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* Makefile (split-init): Set to `yes' by default.
1999-07-111999-07-09 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* init.c (frob_kernel_process): Use mmap instead of vm_allocate.
1999-07-11.Roland McGrath
1999-07-111999-07-10 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* init.c: Add #include <sys/mman.h> for munmap decl.
1999-07-031999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* init.c (reboot_system): Use munmap instead of vm_deallocate. (frob_kernel_process): Likewise. (kill_everyone): Likewise.
1999-06-19.Roland McGrath