Liking cljdoc? Tell your friends :D

jepsen.control.util

Utility functions for scripting installations.

Utility functions for scripting installations.
raw docstring

cached-wget!clj

(cached-wget! url)
(cached-wget! url opts)

Downloads a string URL to the Jepsen wget cache directory, and returns the full local filename as a string. Skips if the file already exists. Local filenames are base64-encoded URLs, as opposed to the name of the file--this is helpful when you want to download a package like https://foo.com/v1.2/foo.tar; since the version is in the URL but not a part of the filename, downloading a new version could silently give you the old version instead.

Options:

:force? Even if we have this cached, download the tarball again anyway.

Downloads a string URL to the Jepsen wget cache directory, and returns the
full local filename as a string. Skips if the file already exists. Local
filenames are base64-encoded URLs, as opposed to the name of the file--this
is helpful when you want to download a package like
https://foo.com/v1.2/foo.tar; since the version is in the URL but not a part
of the filename, downloading a new version could silently give you the old
version instead.

Options:

  :force?     Even if we have this cached, download the tarball again anyway.
raw docstring

daemon-running?clj

(daemon-running? pidfile)

Given a pidfile, returns true if the pidfile is present and the process it contains is alive, nil if the pidfile is absent, false if it's present and the process doesn't exist.

Strictly this doesn't mean the process is RUNNING; it could be asleep or a zombie, but you know what I mean. ;-)

Given a pidfile, returns true if the pidfile is present and the process it
contains is alive, nil if the pidfile is absent, false if it's present and
the process doesn't exist.

Strictly this doesn't mean the process is RUNNING; it could be asleep or a
zombie, but you know what I mean. ;-)
raw docstring

ensure-user!clj

(ensure-user! username)

Make sure a user exists.

Make sure a user exists.
raw docstring

exists?clj

(exists? filename)

Is a path present?

Is a path present?
raw docstring

file?clj

(file? filename)

grepkill!clj

(grepkill! pattern)
(grepkill! signal pattern)

Kills processes by grepping for the given string.

Kills processes by grepping for the given string.
raw docstring

install-archive!clj

(install-archive! url dest)
(install-archive! url dest force?)

Gets the given tarball URL, caching it in /tmp/jepsen/, and extracts its sole top-level directory to the given dest directory. Deletes current contents of dest. Supports both zip files and tarballs, compressed or raw. Returns dest.

Standard practice for release tarballs is to include a single directory, often named something like foolib-1.2.3-amd64, with files inside it. If only a single directory is present, its contents will be moved to dest, so foolib-1.2.3-amd64/my.file becomes dest/my.file. If the tarball includes multiple files, those files are moved to dest, so my.file becomes dest/my.file.

Gets the given tarball URL, caching it in /tmp/jepsen/, and extracts its
sole top-level directory to the given dest directory. Deletes
current contents of dest. Supports both zip files and tarballs, compressed or
raw. Returns dest.

Standard practice for release tarballs is to include a single directory,
often named something like foolib-1.2.3-amd64, with files inside it. If only
a single directory is present, its *contents* will be moved to dest, so
foolib-1.2.3-amd64/my.file becomes dest/my.file. If the tarball includes
multiple files, those files are moved to dest, so my.file becomes
dest/my.file.
raw docstring

install-tarball!clj

(install-tarball! node url dest)
(install-tarball! node url dest force?)

lsclj

(ls)
(ls dir)

A seq of directory entries (not including . and ..). TODO: escaping for control chars in filenames (if you do this, WHO ARE YOU???)

A seq of directory entries (not including . and ..). TODO: escaping for
control chars in filenames (if you do this, WHO ARE YOU???)
raw docstring

ls-fullclj

(ls-full dir)

Like ls, but prepends dir to each entry.

Like ls, but prepends dir to each entry.
raw docstring

start-daemon!clj

(start-daemon! opts bin & args)

Starts a daemon process, logging stdout and stderr to the given file. Invokes bin with args. Options are:

:background? :chdir :logfile :make-pidfile? :match-executable? :match-process-name? :pidfile :process-name

Starts a daemon process, logging stdout and stderr to the given file.
Invokes `bin` with `args`. Options are:

:background?
:chdir
:logfile
:make-pidfile?
:match-executable?
:match-process-name?
:pidfile
:process-name
raw docstring

std-wget-optsclj

A list of standard options we pass to wget

A list of standard options we pass to wget
raw docstring

stop-daemon!clj

(stop-daemon! pidfile)
(stop-daemon! cmd pidfile)

Kills a daemon process by pidfile, or, if given a command name, kills all processes with that command name, and cleans up pidfile.

Kills a daemon process by pidfile, or, if given a command name, kills all
processes with that command name, and cleans up pidfile.
raw docstring

tmp-dir!clj

(tmp-dir!)

Creates a temporary directory under /tmp/jepsen and returns its path.

Creates a temporary directory under /tmp/jepsen and returns its path.
raw docstring

tmp-dir-baseclj

Where should we put temporary files?

Where should we put temporary files?
raw docstring

wget!clj

(wget! url)
(wget! url force?)

Downloads a string URL and returns the filename as a string. Skips if the file already exists.

Downloads a string URL and returns the filename as a string. Skips if the
file already exists.
raw docstring

wget-cache-dirclj

Directory for caching files from the web.

Directory for caching files from the web.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close