Skip to content

Commit

Permalink
Rename nix-worker to nix-daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Oct 3, 2012
1 parent 522ecab commit e35d6f7
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ Makefile.in
# /src/nix-store/
/src/nix-store/nix-store

# /src/nix-worker/
/src/nix-worker/nix-worker
# /src/nix-daemon/
/src/nix-daemon/nix-daemon

# /tests/
/tests/test-tmp
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ AC_CONFIG_FILES([Makefile
src/libexpr/Makefile
src/nix-instantiate/Makefile
src/nix-env/Makefile
src/nix-worker/Makefile
src/nix-daemon/Makefile
src/nix-setuid-helper/Makefile
src/nix-log2xml/Makefile
src/bsdiff-4.3/Makefile
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ man1_MANS = nix-env.1 nix-build.1 nix-store.1 nix-instantiate.1 \

man5_MANS = nix.conf.5

man8_MANS = nix-worker.8
man8_MANS = nix-daemon.8

FIGURES = figures/user-environments.png

Expand Down
4 changes: 2 additions & 2 deletions doc/manual/env-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
<literal>/var/run/nix/remote-stores</literal>.</para>

<para>Note that if you’re building through the <link
linkend="sec-nix-worker">Nix daemon</link>, the only setting for
linkend="sec-nix-daemon">Nix daemon</link>, the only setting for
this variable that matters is the one that the
<command>nix-worker</command> process uses. So if you want to
<command>nix-daemon</command> process uses. So if you want to
change it, you have to restart the daemon.</para></listitem>

</varlistentry>
Expand Down
10 changes: 5 additions & 5 deletions doc/manual/installation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ $ chown -R root /nix/store /nix/var/nix</screen>

</para>

<para>The <link linkend="sec-nix-worker">Nix daemon</link> should be
<para>The <link linkend="sec-nix-daemon">Nix daemon</link> should be
started as follows (as <literal>root</literal>):

<screen>
$ nix-worker --daemon</screen>
$ nix-daemon</screen>

You’ll want to put that line somewhere in your system’s boot
scripts.</para>
Expand Down Expand Up @@ -450,11 +450,11 @@ named anything. It should own the Nix store and database:
<screen>
$ chown -R nix /nix/store /nix/var/nix</screen>

and of course <command>nix-worker --daemon</command> should be started
under that user, e.g.,
and of course <command>nix-daemon</command> should be started under
that user, e.g.,

<screen>
$ su - nix -c "exec /nix/bin/nix-worker --daemon"</screen>
$ su - nix -c "exec /nix/bin/nix-daemon"</screen>

</para>

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/manual.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<xi:include href="nix-prefetch-url.xml" />
<xi:include href="nix-pull.xml" />
<xi:include href="nix-push.xml" />
<xi:include href="nix-worker.xml" />
<xi:include href="nix-daemon.xml" />
</section>

<section>
Expand Down
9 changes: 4 additions & 5 deletions doc/manual/nix-worker.xml → doc/manual/nix-daemon.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-nix-worker">
xml:id="sec-nix-daemon">

<refmeta>
<refentrytitle>nix-worker</refentrytitle>
<refentrytitle>nix-daemon</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo class="source">Nix</refmiscinfo>
<refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo>
</refmeta>

<refnamediv>
<refname>nix-worker</refname>
<refname>nix-daemon</refname>
<refpurpose>Nix multi-user support daemon</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>nix-worker</command>
<arg choice="plain"><option>--daemon</option></arg>
<command>nix-daemon</command>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down
8 changes: 7 additions & 1 deletion doc/manual/release-notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<section xml:id="ssec-relnotes-1.2"><title>Release 1.2 (TBA)</title>

<para>This release has the following improvements:</para>
<para>This release has the following improvements and changes:</para>

<itemizedlist>

Expand Down Expand Up @@ -47,6 +47,12 @@ $ mount -o remount,ro,bind /nix/store
modifications.</para>
</listitem>

<listitem>
<para>The command <command>nix-worker</command> has been renamed
to <command>nix-daemon</command>. Support for running the Nix
worker in “slave” mode has been removed.</para>
</listitem>

</itemizedlist>

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=syslog.target

[Service]
Type=simple
ExecStart=/usr/bin/nix-worker --daemon
ExecStart=/usr/bin/nix-daemon

[Install]
WantedBy=multi-user.target
8 changes: 4 additions & 4 deletions nix.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/nix.sh
%if ! 0%{?rhel}
# install systemd service descriptor
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system
cp -p misc/systemd/nix-worker.service \
cp -p misc/systemd/nix-daemon.service \
$RPM_BUILD_ROOT%{_prefix}/lib/systemd/system/
%endif

Expand Down Expand Up @@ -173,8 +173,8 @@ chgrp %{nixbld_group} /nix/store
chmod 1775 /nix/store
%if ! 0%{?rhel}
# Enable and start Nix worker
systemctl enable nix-worker.service
systemctl start nix-worker.service
systemctl enable nix-daemon.service
systemctl start nix-daemon.service
%endif

%files
Expand All @@ -186,7 +186,7 @@ systemctl start nix-worker.service
%exclude %dir %{perl_vendorarch}/auto/
%{_prefix}/libexec/*
%if ! 0%{?rhel}
%{_prefix}/lib/systemd/system/nix-worker.service
%{_prefix}/lib/systemd/system/nix-daemon.service
%endif
%{_datadir}/emacs/site-lisp/nix-mode.el
%{_datadir}/nix
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SUBDIRS = boost libutil libstore libmain nix-store nix-hash \
libexpr nix-instantiate nix-env nix-worker nix-setuid-helper \
libexpr nix-instantiate nix-env nix-daemon nix-setuid-helper \
nix-log2xml bsdiff-4.3
12 changes: 12 additions & 0 deletions src/nix-daemon/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bin_PROGRAMS = nix-daemon

nix_daemon_SOURCES = nix-daemon.cc
nix_daemon_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
../boost/format/libformat.la

AM_CXXFLAGS = \
-I$(srcdir)/.. -I$(srcdir)/../libutil \
-I$(srcdir)/../libstore -I$(srcdir)/../libmain

install-exec-local:
ln -sf nix-daemon $(DESTDIR)$(bindir)/nix-worker
12 changes: 6 additions & 6 deletions src/nix-worker/nix-worker.cc → src/nix-daemon/nix-daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using namespace nix;
disconnects and immediately kill any ongoing builds. On platforms
that lack it, we only notice the disconnection the next time we try
to write to the client. So if you have a builder that never
generates output on stdout/stderr, the worker will never notice
generates output on stdout/stderr, the daemon will never notice
that the client has disconnected until the builder terminates. */
#ifdef O_ASYNC
#define HAVE_HUP_NOTIFICATION
Expand Down Expand Up @@ -677,7 +677,7 @@ static void processConnection()
/* Prevent users from doing something very dangerous. */
if (geteuid() == 0 &&
querySetting("build-users-group", "") == "")
throw Error("if you run `nix-worker' as root, then you MUST set `build-users-group'!");
throw Error("if you run `nix-daemon' as root, then you MUST set `build-users-group'!");
#endif

/* Open the store. */
Expand Down Expand Up @@ -724,7 +724,7 @@ static void processConnection()
assert(!canSendStderr);
};

printMsg(lvlError, format("%1% worker operations") % opCount);
printMsg(lvlError, format("%1% operations") % opCount);
}


Expand Down Expand Up @@ -858,7 +858,7 @@ static void daemonLoop()
case 0:
try { /* child */

/* Background the worker. */
/* Background the daemon. */
if (setsid() == -1)
throw SysError(format("creating a new session"));

Expand Down Expand Up @@ -907,8 +907,8 @@ void run(Strings args)

void printHelp()
{
showManPage("nix-worker");
showManPage("nix-daemon");
}


string programId = "nix-worker";
string programId = "nix-daemon";
9 changes: 0 additions & 9 deletions src/nix-worker/Makefile.am

This file was deleted.

4 changes: 2 additions & 2 deletions tests/common.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ clearManifests() {

startDaemon() {
# Start the daemon, wait for the socket to appear. !!!
# ‘nix-worker’ should have an option to fork into the background.
# ‘nix-daemon’ should have an option to fork into the background.
rm -f $NIX_STATE_DIR/daemon-socket/socket
nix-worker --daemon &
nix-daemon &
for ((i = 0; i < 30; i++)); do
if [ -e $NIX_STATE_DIR/daemon-socket/socket ]; then break; fi
sleep 1
Expand Down

0 comments on commit e35d6f7

Please sign in to comment.