LinuxCommandLibrary

func

Manage and interact with functions

TLDR

Create a new functions project

$ func init [project]
copy

Create a new function
$ func new
copy

Run functions locally
$ func start
copy

Publish your code to a function app in Azure
$ func azure functionapp publish [function]
copy

Download all settings from an existing function app
$ func azure functionapp fetch-app-settings [function]
copy

Get the connection string for a specific storage account
$ func azure storage fetch-connection-string [storage_account]
copy

SYNOPSIS

func [options] [minions] [--] command [args]

PARAMETERS

-h, --help
    Show help message and exit

-v, --verbose
    Increase verbosity (can repeat for more detail)

-q, --quiet
    Suppress non-error output

-s, --stream
    Stream output as received from minions

-b BATCHSIZE, --batch-size=BATCHSIZE
    Max minions to process concurrently (default: 100)

-t TIMEOUT, --timeout=TIMEOUT
    Command timeout in seconds (default: 0, no timeout)

-u USER, --user=USER
    Run command as specified user on minions

-g, --group
    Treat minion arg as group name

--minion-from-file=FILE
    Read minions from file

--shell=PATH
    Path to shell on minions

DESCRIPTION

func is a powerful tool for system administrators to execute commands in parallel across multiple remote Linux/Unix hosts. It operates in a client-server model where target machines, called minions, are registered via certmaster for secure authentication using certificates.

Users specify minions (hosts, groups, or certnames), followed by the command and arguments. Func dispatches jobs concurrently, streaming output in real-time with options for batching and verbosity control. It's ideal for large-scale tasks like software updates, service management, or monitoring in environments integrated with Cobbler.

Key strengths include fault-tolerant execution (continues on failures), grouping for organization, and minimal setup for SSH-based fallbacks. However, it relies on a central func server and minion daemons, making it suited for managed clusters rather than ad-hoc use.

CAVEATS

Requires certmaster and func-overlord/minion setup; insecure without certs; deprecated in favor of modern tools like Ansible; may fail on non-registered hosts.

EXAMPLES

func webservers uptime
func -s dbgroup yum update -y
func -b 20 all -- service httpd restart

AUTHENTICATION

Uses X.509 certs via certmaster; minions must run funcd daemon and register with overlord.

HISTORY

Developed by Michael DeHaan in 2007 as part of Cobbler for Fedora/Red Hat ecosystems. Integrated into EPEL; peaked in usage around 2008-2012 for cluster management. Largely unmaintained since 2013, superseded by Ansible (also by DeHaan).

SEE ALSO

certmaster(1), pdsh(1), dsh(1), ansible(1)

Copied to clipboard