.\" Copyright © 2010 Roger Leigh .\" .\" schroot is free software: you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 3 of the License, or .\" (at your option) any later version. .\" .\" schroot 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, see .\" . .\" .ds RELEASE_DATE 14 Aug 2022 .ds VERSION 1.6.13 .ds SCHROOT_LIBEXEC_DIR /usr/lib/schroot .ds SCHROOT_MOUNT_DIR /var/run/schroot/mount .ds SCHROOT_SESSION_DIR /var/lib/schroot/session .ds SCHROOT_FILE_UNPACK_DIR /var/lib/schroot/unpack .ds SCHROOT_OVERLAY_DIR /var/lib/schroot/union/overlay .ds SCHROOT_UNDERLAY_DIR /var/lib/schroot/union/underlay .ds SCHROOT_SYSCONF_DIR /etc/schroot .ds SCHROOT_CONF /etc/schroot/schroot.conf .ds SCHROOT_CONF_CHROOT_D /etc/schroot/chroot.d .ds SCHROOT_CONF_SETUP_D /etc/schroot/setup.d .ds SCHROOT_DATA_DIR /usr/share/schroot .ds SCHROOT_SETUP_DATA_DIR /usr/share/schroot/setup .ds SCHROOT_LOCALE_DIR /usr/share/locale .ds PACKAGE_LOCALE_DIR /usr/share/locale .ds PROGRAM schroot .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH SCHROOT\-FAQ 7 \*[RELEASE_DATE] "Version \*[VERSION]" "Debian sbuild" .SH NAVN schroot \- ofte stillede spørgsmål .SH BESKRIVELSE Denne manualside dækker diverse ofte stillede spørgsmål om konfiguration og brug af schroot. .SH KONFIGURATION .SS "Hvorfor overskriver schroot konfigurationsfiler i chroot'en?" By default, schroot copies over the system NSS databases (\[oq]passwd\[cq], \[oq]shadow\[cq], \[oq]group\[cq], \[oq]gshadow\[cq], \[oq]services\[cq], \[oq]protocols\[cq], \[oq]networks\[cq], and \[oq]hosts\[cq], etc.) into the chroot. The reason for this is that the chroot environment is not a completely separate system, and it copying them over keeps them synchronised. However, this is not always desirable, particularly if installing a package in the chroot creates system users and groups which are not present on the host, since these will disappear next time the databases are copied over. .PP The suggested workaround here is to disable the copying. This may be achieved by setting the \f[CI]setup.nssdatabases\fR key to be empty in \fIschroot.conf\fP. In prior schroot releases, this was done by commenting out the NSSDATABASES file for the chroot (\fI\*[SCHROOT_SYSCONF_DIR]/default/config\fP by default). The database list may also be customised by editing the file containing the database list (\fI\*[SCHROOT_SYSCONF_DIR]/default/nssdatabases\fP by default). .PP In the future, we will be working on a better scheme for keeping the host and chroot databases in sync which can merge entries rather than overwriting the entire database, which would preserve chroot\-specific changes. .SS "Should I use the plain or directory chroot type?" These two chroot types are basically equivalent, since they are both just directories in the filesystem. plain is very simple and does not perform any setup tasks; the only reason you would want to use it is if you're upgrading from a program such as \fBdchroot(1)\fP or \fBchroot(8)\fP which don't do anything other than running a command or shell in a directory. On the other hand, directory chroots do run setup scripts, which can mount additional filesystems and do other setup tasks. .SH "AVANCERET KONFIGURATION" .SS "What are snapshots and unions?" Some chroot types support \fIcloning\fP. This means when you start a session, you get a \fIcopy\fP of the chroot which lasts just for the lifetime of the session. This is useful when you want a temporary clean copy of a system for a single task, which is then automatically deleted when you're done with it. For example, the Debian package build d\[ae]mons run \fBsbuild\fP(1) to build Debian packages, and this program uses schroot to create a clean build environment for each package. Without snapshotting, the chroot would need to be reset to its initial state at the end of each build to make it ready for the next one, and any debris left over from package removals or earlier builds could interfere with the next build. .PP The most commonly\-used snapshotting method is to use LVM snapshots (chroot type \[oq]lvm\-snapshot\[cq]). In this case the chroot must exist on an LVM logical volume (LV); snapshots of an LV may then be made with \fBlvcreate\fP(8) during chroot session setup. However, these use up a lot of disk space. A newer method is to use Btrfs snapshots which use up much less disk space (chroot type \[oq]btrfs\-snapshot\[cq]), and may be more reliable than LVM snapshots. Btrfs is however still experimental, but it is hoped that it will become the recommended method as it matures. .PP Unions are an alternative to snapshots. In this situation, instead of creating a copy of the chroot filesystem, we overlay a read\-write temporary filesystem on top of the chroot filesystem so that any modifications are stored in the overlay, leaving the original chroot filesystem untouched. The Linux kernel has yet to integrate support for union filesystems such as aufs and unionfs, so LVM snapshots are still the recommended method at present. .SH BRUG .SS "Kan jeg køre en d\[ae]mons i en chroot?" A common problem is trying to run a d\[ae]mon in a chroot, and finding that this doesn't work. Typically, the d\[ae]mon is killed shortly after it starts up. .PP When schroot runs, it begins a session, runs the specified command or shell, waits for the command or shell to exit, and then it ends the session. For a normal command or shell, this works just fine. However, d\[ae]mons normally start up by running in the background and detaching from the controlling terminal. They do this by forking twice and letting the parent processes exit. Unfortunately, this means schroot detects that the program exited (the d\[ae]mon is a orphaned grandchild of this process) and it then ends the session. Part of ending the session is killing all processes running inside the chroot, which means the d\[ae]mon is killed as the session ends. .PP In consequence, it's not possible to run a d\[ae]mon \fIdirectly\fP with schroot. You can however do it if you create a session with \fI\-\-begin\-session\fP and then run the d\[ae]mon with \fI\-\-run\-session\fP. It's your responsibility to end the session with \fI\-\-end\-session\fP when the d\[ae]mon has terminated or you no longer need it. .SS "Hvordan rydder jeg manuelt op i en ødelagt session?" Occasionally, it may be necessary to manually clean up sessions. If something changes on your system which causes the setup scripts to fail when ending a session, for example removal of a needed file or directory, it may not be possible for schroot to clean everything up automatically. For each of the session directories listed in the \[lq]\fISession directories\fP\[rq] section in \fBschroot\fP(1), any files with the name of the session ID need deleting, and any directories with the name of the session ID need umounting (if there are any filesystems mounted under it), and then also removing. .PP For eksempel, for at fjerne en session navngivet \fImin\-session\fP manuelt: .IP \[bu] Fjern sessionskonfigurationsfilen .EX %\ \f[CB]rm\ \*[SCHROOT_SESSION_DIR]/min\-session\fR\[CR] .EE .IP \[bu] Kontroller for monterede filsystemer .EX %\ \f[CB]\*[SCHROOT_LIBEXEC_DIR]/schroot\-listmounts\ \-m\ \e \*[SCHROOT_MOUNT_DIR]/min\-session\fR\[CR] .EE .IP \[bu] Afmonter alle monterede filsystemer .IP \[bu] Fjern \fI\*[SCHROOT_MOUNT_DIR]/min\-session\fP .IP \[bu] Gentag for andre mapper såsom \fI\*[SCHROOT_UNDERLAY_DIR]\fP, \fI\*[SCHROOT_OVERLAY_DIR]\fP og \fI\*[SCHROOT_FILE_UNPACK_DIR]\fP .PP \fBNOTE:\fP Fjern ikke mapper uden at kontroller om der er filsystemer monteret i dem, da filsystemer såsom \fI/home\fP stadig kan være bind\-monteret. Dette kan medføre tab af data! .SH "AVANCERET BRUG " .SS "Hvordan bruger jeg sessioner?" Under normal brug kan kørsel af en kommando se således ud: .EX %\ \f[CB]schroot\ \-c squeeze \-\- kommando\fR\[CR] .EE .PP Som vil køre kommandoen \fIkommando\fP i \fIsqueeze\fP\-chroot'en. Selv om det ikke er indlysende at en seesion bruges her, så udfører schroot faktisk de følgende trin: .IP \[bu] Oprettelse af en session med brug af \fIsqueeze\fP\-chroot'en. Denne vil automatisk får et unikt navn, såsom \fIsqueeze\-57a69547\-e014\-4f5d\-a98b\-f4f35a005307\fP, selvom du ikke nødvendigvis kender til dette .IP \[bu] Opsætningsskripter køres for at oprette sessionschroot'en og konfigurere den for dig. .IP \[bu] Kommandoen \fIkommando\fP køres inden i sessionschroot'en .IP \[bu] Opsætningsskripter køres for at rydde op i sessionschroot'en .IP \[bu] Sessionen slettes .PP Now, if you wanted to run more than one command, you could run a shell and run them interactively, or you could put them into shell script and run that instead. But you might want to do something in between, such as running arbitrary commands from a program or script where you don't know which commands to run in advance. You might also want to preseve the chroot state in between commands, where the normal automatic session creation would reset the state in between each command. This is what sessions are for: once created, the session is persistent and won't be automatically removed. With a session, you can run as many commands as you like, but you need to create and delete the session by hand since schroot can't know by itself when you're done with it unlike in the single command case above. This is quite easy: .EX % \f[CB]schroot \-\-begin\-session \-c squeeze\fR\[CR] squeeze\-57a69547\-e014\-4f5d\-a98b\-f4f35a005307 .EE .PP This created a new session based upon the \fIsqueeze\fP chroot. The unique name for the session, the session ID, was printed to standard output, so we could also save it as a shell variable at the same time like so: .EX % \f[CB]SESSION=$(schroot \-\-begin\-session \-c squeeze)\fR\[CR] % \f[CB]echo $SESSION\fR\[CR] squeeze\-57a69547\-e014\-4f5d\-a98b\-f4f35a005307 .EE .PP Nu vi har oprettet sessionen og fået sessions\-id'et, så kan vi køre kommandoer i den via brug af sessions\-id'et: .EX % \f[CB]schroot \-\-run\-session \-c squeeze\-57a69547\-e014\-4f5d\-a98b\-f4f35a005307 \e \-\- kommando1\fR\[CR] .EE .PP eller .EX % \f[CB]schroot \-\-run\-session \-c "$SESSION" \-\- kommando1\fR\[CR] .EE .PP og så det antal kommandoer vi ønsker .EX % \f[CB]schroot \-\-run\-session \-c "$SESSION" \-\- kommando2\fR\[CR] % \f[CB]schroot \-\-run\-session \-c "$SESSION" \-\- kommando3\fR\[CR] % \f[CB]schroot \-\-run\-session \-c "$SESSION" \-\- kommando4\fR\[CR] .EE .PP etc. .PP Når vi er færdig med sessionen, så kan vi fjerne den med \fI\-\-end\-session\fP: .EX % \f[CB]schroot \-\-end\-session \-c squeeze\-57a69547\-e014\-4f5d\-a98b\-f4f35a005307\fR\[CR] .EE .PP eller .EX % \f[CB]schroot \-\-end\-session \-c "$SESSION"\fR\[CR] .EE .PP Da de automatisk oprettede sessionsnavne kan være lange og uhåndterlige, giver tilvalget \fI\-\-session\-name\fP dig mulighed for at angive dit eget navn: .PP .EX % \f[CB]schroot \-\-begin\-session \-c squeeze \-\-session\-name mit\-navn\fR\[CR] mit\-navn .EE .SH BIDRAG .SS "Få hjælp og bliv involveret" Postlisten \f[CR]\fR bruges til både brugerhjælp og udviklingsdiskussion. Listen kan tilmeldes på projektes hjemmeside \f[CR]https://alioth.debian.org/projects/buildd\-tools/\fR eller via Mailmans listegrænseflade \f[CR]http://lists.alioth.debian.org/mailman/listinfo/buildd\-tools\-devel\fR. .SS "Indsendelse af fejlrapporter" På Debiansystemer kan fejl rapporteres via værktøjet \fBreportbug\fP(1) eller alternativt med post \f[CR]\fR (se \f[CR]http://bugs.debian.org\fR for detaljer om hvordan dette gøres. .SS "Hent de seneste kilder" schroot vedligeholdes i versionskontrolsystemet git. Du kan hente de seneste kilder fra \f[CR]git://git.debian.org/git/buildd\-tools/schroot\fR. .EX % \f[CB]git clone git://git.debian.org/git/buildd\-tools/schroot\fR\[CR] .EE .LP Hovedgrenen (master) indeholder den nuværende udviklingsudgivelse. Stabile udgivelser findes i andre grene, for eksempel serien 1.4 i grenen schroot\-1.4. .SH FORFATTERE Roger Leigh. .SH OPHAVSRET Ophavsret \(co 2005\-2012 Roger Leigh \f[CR]\fR .PP \fB\*[PROGRAM]\fP er frit programmel: Du kan videredistribuere det og/eller ændre det under betingelserne i GNU General Public License som udgivet af Free Software Foundation, enten version 3 af licensen, eller (efter dit valg) enhver senere version. .SH "SE OGSÅ" \fBdchroot\fP(1), \fBsbuild\fP(1), \fBschroot\fP(1), \fBschroot.conf\fP(5). \fBschroot\-setup\fP(5), .\"# .\"# The following sets edit modes for GNU EMACS .\"# Local Variables: .\"# mode:nroff .\"# fill-column:79 .\"# End: