summaryrefslogtreecommitdiff
path: root/startup
AgeCommit message (Collapse)Author
2019-09-01Use the data_t type defined in hurd_types.h.Flavio Cruz
* boot/boot.c: Replace char* with data_t. * console-client/trans.c: Likewise. * exec/exec.c: Likewise. * ext2fs/storeinfo.c: Likewise. * fatfs/inode.c: Likewise. * fatfs/main.c: Likewise. * isofs/inode.c: Likewise. * libdiskfs/boot-start.c: Likewise. * libdiskfs/dir-readdir.c: Likewise. * libdiskfs/file-exec.c: Likewise. * libdiskfs/file-get-fs-opts.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-set-trans.c: Likewise. * libdiskfs/fsys-forward.c: Likewise. * libdiskfs/fsys-getfile.c: Likewise. * libdiskfs/fsys-options.c: Likewise. * libdiskfs/io-read.c: Likewise. * libdiskfs/io-write.c: Likewise. * libnetfs/dir-readdir.c: Likewise. * libnetfs/file-exec.c: Likewise. * libnetfs/file-get-fs-options.c: Likewise. * libnetfs/file-get-storage-info.c: Likewise. * libnetfs/file-get-translator.c: Likewise. * libnetfs/file-set-translator.c: Likewise. * libnetfs/fsstubs.c: Likewise. * libnetfs/fsys-get-options.c: Likewise. * libnetfs/fsys-set-options.c: Likewise. * libnetfs/fsysstubs.c: Likewise. * libnetfs/io-read.c: Likewise. * libnetfs/io-write.c: Likewise. * libtrivfs/dir-readdir.c: Likewise. * libtrivfs/file-get-fs-options.c: Likewise. * libtrivfs/file-get-storage-info.c: Likewise. * libtrivfs/file-get-trans.c: Likewise. * libtrivfs/file-getfh.c: Likewise. * libtrivfs/file-set-trans.c: Likewise. * libtrivfs/fsys-forward.c: Likewise. * libtrivfs/fsys-get-options.c: Likewise. * libtrivfs/fsys-set-options.c: Likewise. * libtrivfs/fsys-stubs.c: Likewise. * libtrivfs/io-read.c: Likewise. * libtrivfs/io-write.c: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/pfinet-ops.c: Likewise. * pfinet/socket-ops.c: Likewise. * pfinet/tunnel.c: Likewise. * pflocal/io.c: Likewise. * pflocal/pf.c: Likewise. * pflocal/socket.c: Likewise. * proc/info.c: Likewise. * startup/startup.c: Likewise. * storeio/io.c: Likewise. * term/users.c: Likewise. * tmpfs/node.c: Likewise. * trans/crash.c: Likewise. * trans/fakeroot.c: Likewise. * trans/fifo.c: Likewise. * trans/firmlink.c: Likewise. * trans/hello-mt.c: Likewise. * trans/hello.c: Likewise. * trans/mtab.c: Likewise. * trans/new-fifo.c: Likewise. * trans/null.c: Likewise. * trans/proxy-defpager.c: Likewise. * trans/streamio.c: Likewise.
2019-03-03shutdown: rename shutdown RPC to shutdown_shutdownSamuel Thibault
For coherency with usage, and to avoid conflicting with shutdown(2) * hurd/shutdown.defs (shutdown): Rename to shutdown_shutdown. * shutdown/shutdown.c (S_shutdown): Rename to S_shutdown_shutdown. * startup/startup.c (do_shutdown): Call shutdown_shutdown instead of shutdown.
2019-03-03shutdown: fallback on Mach shutdownSamuel Thibault
* startup/startup.c (reboot_mach): In case do_shutdown returns, fallback to Mach's host_reboot.
2019-03-02Add to startup relevant shutdown rpc callDamien Zammit
* startup/Makefile (OBJS): Add shutdownUser.o. * startup/startup.c: Include <stdlib.h> and "shutdown_U.h". (_SERVERS_SHUTDOWN): New macro. (do_shutdown): New function. (reboot_mach): Call do_shutdown when flags contains RB_HALT.
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>.
2018-01-08Implement /proc/<pid>/exeSamuel Thibault
by adding proc_set/get_exe to the proc server, making exec call proc_set_exe, and libps call proc_get_exe. procfs can then just retrieve the information to make the "exe" symlink. * hurd/process.defs (proc_set_exe, proc_get_exe): New RPCs. * hurd/process_request.defs: Likewise. * hurd/process_reply.defs: Add skips for proc_set_exe and proc_get_exe RPCs. * proc/proc.h (struct proc): Add `exe' field. * proc/info.c (S_proc_set_exe, S_proc_get_exe): New functions. * proc/mgt.c (process_has_exited): Free p->exe. (S_proc_child): Duplicate parent `exe' into child's `exe'. * exec/exec.c (do_exec): Call proc_set_exe when a filename is available. * libps/ps.h (struct proc_stat): Add `exe_vm_alloced', `exe', and `exe_len' field. (PSTAT_EXE): New macro. (PSTAT_USER_BASE): Change value to make room. (proc_stat_exe, proc_stat_exe_len): New macros. * libps/procstat.c (proc_stat_set_flags): Handle PSTAT_EXE case by calling proc_get_exe. * libps/spec.c (ps_get_exe): New function. (ps_exe_getter): New structure. (ps_fmt_spec): Add "Exe" specification. * procfs/process.c (process_file_symlink_make_node, process_file_gc_exe): New functions. (procfs_dir_entry): Add "exe" entry. * startup/startup.c (launch_core_servers): Set exe paths for startup, auth, proc, and fs servers. (frob_kernel_process): Set exe path for kernel task. (S_startup_essential_task): Set exe path for exec server.
2018-01-08Add a file_exec_file_name RPCEmilio Pozuelo Monfort
* hurd/fs.defs (file_exec): Deprecate in favor of... (file_exec_paths): ...this new RPC. * TODO: Update. * doc/hurd.texi: Update RPC name. * hurd/hurd_types.h: Update RPC name. * libdiskfs/boot-start.c: Update RPC name. * configure.ac: Check for presence of RPC stubs file_exec_paths exec_exec_paths. * exec/hashexec.c (check_hashbang): When file_exec_paths is available, use it instead of file_exec. * startup/startup.c (run, run_for_real, start_child): Likewise. * utils/login.c (main): Likewise. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Likewise. * libdiskfs/file-exec.c (diskfs_S_file_exec): Move code to new function diskfs_S_file_exec_paths and call it. (diskfs_S_file_exec_paths): New function, use exec_exec_paths when available instead of exec_exec * libnetfs/file-exec.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * trans/fakeroot.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * libtrivfs/file-exec.c (trivfs_S_file_exec_paths): New function.
2017-08-25startup: Don't spin on host_reboot failures.Justus Winter
* startup/startup.c (reboot_mach): Do not retry needlessly if host_reboot fails.
2017-08-11startup: Improve error handling.Justus Winter
* startup/startup.c (main): Improve error handling.
2017-08-11startup: Fix retrieving the privileged ports.Justus Winter
* startup/startup.c: Give the privileged ports to the glibc so that other code can get them.
2017-08-05Use our own variant of 'assert' and 'assert_perror'.Justus Winter
Our variants print stack traces on failures. This will make locating errors much easier.
2017-03-12Pass the kernel's task port to proc.Justus Winter
Previously, the early server bootstrap relied upon a specific task layout to determine the kernels task port. Explicitly pass it from the kernel instead. * boot/boot.c (default_boot_script): Add '--kernel-task' parameter to ext2fs. (main): New bootscript variable 'kernel-task'. * libdiskfs/boot-start.c (diskfs_kernel_task): Declaration variable. (diskfs_start_bootstrap): If '--kernel-task' was given to us, pass it along to startup. * libdiskfs/opts-std-startup.c (diskfs_kernel_task): New variable. (startup_options): Add '--kernel-task' option. (parse_startup_opt): Handle option. * proc/main.c (kernel_task): New variable. (OPT_KERNEL_TASK): New macro. (options): New variable. (parse_opt): New function. (main): Parse options. Use 'kernel_task' if provided. * release/servers.boot: Add '--kernel-task' parameter to ext2fs. * startup/startup.c (OPT_KERNEL_TASK): New macro. (options): Add '--kernel-task' option. (kernel_task): New variable. (insert_ports_fnc_t): New declaration. (run): Add argument for a function that inserts rights into the newly created task and adds arguments to the argument vector. (argz_task_insert_right): New function. (proc_insert_ports): Likewise. (parse_opt): New function. (main): Pass the kernel's task port to proc. (frob_kernel_process): Use the kernel's task port.
2017-03-12startup: Simplify reference handling.Justus Winter
* startup/startup.c (launch_core_servers): Instead of copying a send right and then deallocating it, move it. (init_stdarrays): Likewise.
2017-01-09startup: insert the kernel name in its commande lineRichard Braun
This cosmetic change sets argv[0] to "gnumach", making it easier to identify the kernel process. * startup/startup.c (frob_kernel_process): Insert "gnumach" at the start of the kernel command line arguments.
2016-11-01startup: Dump processes if we cannot find the kernel.Justus Winter
* startup/startup.c (dump_processes): New function. (frob_kerne_process): Use the new function.
2016-09-01Fix looping over runsystem possibilitiesSamuel Thibault
* startup/startup.c (launch_something): Always increment TRY even on success, so that if runsystem unexpectedly returns, we get to try a shell instead.
2016-09-01startup: Fix looping over runsystemSamuel Thibault
Thanks Brent W. Baccala for the report. * starpu/startup.c (launch_something): Always increment TRY while looping over runsystem possibilities.
2016-08-08startup: Make the kernel a child of startup.Justus Winter
* startup/startup.c (frob_kernel_process): Make the kernel a child of startup, improve error reporting.
2016-05-09startup: fix blunderJustus Winter
Fixes b04364bc. Thanks to Esa Peuha for spotting this. * startup/startup.c (run): Fix blunder.
2016-04-28startup: write all messages to stderrJustus Winter
This avoids the need to flush the buffer and works around a weird problem with 'puts' not printing a newline. * startup/startup.c: Write all messages to stderr.
2016-04-28startup: use the generated default server implementationsJustus Winter
* startup/Makefile: Set appropriate flags. * startup/startup.c: Drop most stub functions.
2016-04-28startup: add verbose parameterJustus Winter
* startup/startup.c: Add verbose parameter and inform about progress through the bootstrap procedure if it is given.
2016-04-28startup: implement bits of the fs and io protocolsJustus Winter
* startup/Makefile: Build fs and io server with default implementations. (mung_msg_S.h): Tune regexp only to match the include guard. * startup/startup.c (mig_reply_setup): New function. (demuxer): Add new protocols. Nicer implementation. (S_file_check_access): New function. (S_io_restrict_auth): Likewise.
2015-12-29fix compiler warnings in hurd/startupFlavio Cruz
startup: Fix compiler warning. * startup/startup.c (do_mach_notify_dead_name): Fix format string.
2015-07-14exec: fix setting the name of early serversJustus Winter
Previously, the exec server did not set the name of the servers started before the proc server. Instead this was done by the startup server, but this was merely a workaround, missing notably the startup server itself. * exec/exec.c (set_name): New function. (do_exec): Move the code setting the name to a new function, and also call it if the proc server is not started yet. * startup/startup.c (run): Drop hack.
2015-02-08startup: add more error handlingJustus Winter
* startup/startup.c (launch_core_servers): Add more error handling.
2015-01-17proc: call `startup_essential_task' earlierJustus Winter
Previously, the proc server did not call `startup_essential_task' until it got the message port of the startup server using `proc_setmsgport'. Now that we have `/servers/startup', we can do this in main, before we start our message service loop. A complication arises because the traditional startup server is single-threaded. Handle this by tweaking startup not to bind itself to `/servers/startup' before it is ready. * proc/main.c (main): Try to lookup `/servers/startup' and send the message here, or... * proc/msg.c (S_proc_setmsgport): ... fall back to the old way here. * proc/proc.h (startup_fallback): New variable. * startup/startup.c (main): Move code installing ourself on `/servers/startup' (install_as_translator): ... here. (launch_core_servers): And use it here, just before we reply to `/hurd/auth'.
2015-01-17startup: give the tasks we create a nameJustus Winter
* startup/startup.c (run): Name the tasks we start.
2014-12-10Replace `bzero' with `memset'Justus Winter
For reference, this patch was created using the following semantic patch, and then manually applying the change in all functions containing nested functions, as those are not supported by Coccinelle. @@ expression A, B; @@ - bzero (A, B) + memset (A, 0, B) * auth/auth.c: Replace `bzero' with `memset'. * boot/boot.c: Likewise. * defpager/defpager.c: Likewise. * exec/exec.c: Likewise. Also, drop `safe_bzero' and just use `hurd_safe_memset' directly. * ext2fs/ext2fs.c: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/pager.c: Likewise. * fatfs/pager.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/netfs.c: Likewise. * isofs/inode.c: Likewise. * isofs/pager.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-statfs.c: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/start-translator.c: Likewise. * libftpconn/create.c: Likewise. * libftpconn/open.c: Likewise. * libftpconn/unix.c: Likewise. * libpipe/pipe.c: Likewise. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libstore/argp.c: Likewise. * libstore/enc.c: Likewise. * libstore/kids.c: Likewise. * libthreads/alpha/thread.c: Likewise. * libtreefs/fsys.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/glue-include/asm/uaccess.h: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/options.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pflocal/io.c: Likewise. * startup/startup.c: Likewise. * storeio/storeio.c: Likewise. * sutils/fstab.c: Likewise. * usermux/usermux.c: Likewise. * utils/fakeauth.c: Likewise. * utils/frobauth.c: Likewise. * utils/login.c: Likewise. * utils/x.c: Likewise.
2014-12-07startup: disable default payload to port mappingJustus Winter
startup does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * startup/Makefile (MIGSFLAGS): Disable the default payload to port translation function.
2014-11-21startup: also open `console' for readingJustus Winter
* startup/startup.c (main): Also open `console' for reading.
2014-11-21startup: bind the startup server to /servers/startupJustus Winter
Previously, the Hurd (ab)used the fact that the startup server speaks all protocols on its message port. Any server that wished to register for shutdown notifications would use proc_getmsgport to get a port to the startup server. This hardcodes the PID of /hurd/startup, and does not allow one to point a server to ones own startup server (e.g. using remap). Bind the startup server to /servers/startup instead. Use this to contact the startup server. * exec/main.c (S_exec_init): Use /servers/startup. Fall back to the old method so that the system still boots when the node /servers/startup is missing. * hurd/paths.h (_SERVERS_STARTUP): New macro. * libdiskfs/boot-start.c (diskfs_S_fsys_init): Use /servers/startup. * libdiskfs/init-startup.c (_diskfs_init_completed): Likewise. * pfinet/main.c (arrange_shutdown_notification): Likewise. * startup/Makefile (OBJS): Add fsysServer.o. * startup/startup.c (demuxer): Handle the fsys protocol. (main): Bind to /servers/startup. (S_fsys_getroot): Implement fsys_getroot. Stub out the rest.
2014-11-21startup: fix the declaration of the *_server functionsJustus Winter
* startup/startup.c (demuxer): Fix the declaration of the server functions.
2014-11-21startup: be more specific in the shutdown messageJustus Winter
Use the BOOT macro to print either halt or reboot instead of the generic shutdown in the event of an system shutdown. * startup/startup.c (reboot_system): Use more specific message.
2014-11-21startup: do not pass signals on to the childJustus Winter
Formerly /hurd/startup would forward all signals to the child it started (e.g. /libexec/runsystem). The motivation for doing so is not revealed in the comments, nor it is mentioned in the history of the version control system. This patch removes the forwarding of signals to the child. * startup/startup.c (process_signal): Do not pass signals on to the child. * startup/stubs.c: Remove file. * startup/Makefile: Remove stubs.c.
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.