Tema: automation
-
rc.conf, sysrc and service on FreeBSD: enabling, starting and checking what runs at boot
FreeBSD services are enabled declaratively by an rc.conf variable (in /etc/rc.conf or a per-service file in /etc/rc.conf.d); sysrc and service <name> enable both just write that variable, and rc.conf itself is not supposed to run anything directly — it only sets variables that the rc scripts in /etc/rc.d read. sysrc edits those variables safely from a script, and service starts, stops and reports the status of the matching rc.d script.
-
Why an unattended script fails silently on macOS: TCC permissions for files, Accessibility and Automation
macOS mediates access to files outside an app's container, keyboard/screen control, and cross-app Apple Events through TCC, keyed to the code identity of the calling binary rather than the Unix user — so root does not bypass it, and a rebuilt unsigned or ad-hoc-signed tool starts the grant process over.
-
Setting locale, timezone and reconfiguring packages non-interactively on Debian and Ubuntu
localectl, timedatectl and update-locale change locale and timezone without a text-mode dialog, and dpkg-reconfigure -f noninteractive re-runs a package's debconf-driven setup the same way a script would run the original install, both usable in provisioning scripts with no terminal attached.
-
Ansible ad-hoc commands and check mode for a safe first run against a fleet
An ad-hoc `ansible` command runs one module against one or more hosts without a playbook, and combining it with `--check --diff` and a narrow `--limit` lets an agent see what a change would do to a fleet before it does it.
-
Automating z/OS through z/OSMF: the jobs, datasets, and files REST APIs
z/OSMF exposes z/OS jobs, datasets, and z/OS UNIX files as ordinary HTTPS/REST resources, which makes it the most agent-friendly interface to the system; requests need the X-CSRF-ZOSMF-HEADER custom header (state-changing ones are rejected without it), and responses use standard HTTP status codes rather than 3270 message text.
-
systemd timers as a cron replacement: OnCalendar, Persistent= and RandomizedDelaySec
A systemd .timer unit paired with a oneshot .service can replace a crontab entry while adding catch-up runs after downtime and random jitter across a fleet. This methodology writes, validates and enables such a pair and explains what Persistent= and RandomizedDelaySec= actually do.
-
Using SMIT as a command generator instead of a menu system
smit/smitty menus ultimately run ordinary AIX commands, and the tool is built to show you which ones: the output window displays the constructed command statement, and smit.log/smit.script capture every command and its exact flags with timestamps. Reading smit.script after a menu-driven task is a fast way to learn the equivalent non-interactive command.
-
Updating FreeBSD: freebsd-update for the base system, pkg upgrade for packages, and pkg audit for known vulnerabilities
FreeBSD splits patching into two independent tools: freebsd-update fetch/install for the base system (with upgrade -r for a major release change), and pkg upgrade for installed packages. pkgbase — installing the base system itself as pkg(8) packages — is documented as experimental on FreeBSD 14 and a technology preview for FreeBSD 15.0, not yet the default path.
-
Running Linux administrative commands non-interactively for unattended agents
Interactive defaults — a pager, a confirmation prompt, a locale that reformats numbers, a sudo password prompt with no terminal to answer it — are the most common reasons an unattended agent session hangs or misparses output on Linux. This article lists the flags and environment variables that turn each one off.
-
launchd domains: choosing a LaunchAgent or LaunchDaemon and loading it with launchctl
LaunchAgents and LaunchDaemons live in different directories, run in different launchd domains, and are managed with the modern bootstrap/bootout/enable/kickstart/print subcommands rather than the deprecated load/unload pair. This methodology covers picking the right domain, writing a minimal plist, and checking status.
-
Storing secrets for unattended scripts: systemd credentials, DPAPI, macOS keychain — and what not to do
Each OS has a mechanism to hand a script a secret without an environment variable or command-line argument that any co-resident process or log can read: systemd's LoadCredential=, Windows DPAPI via Export-Clixml or SecretManagement, and the macOS keychain via security find-generic-password.
-
Detecting the operating system from a script: uname, os-release, sw_vers, oslevel and a fallback order
A portable script needs a reliable way to branch on operating system and version before running an OS-specific command from any of the other articles in this series. This methodology gives a fallback order — from the most specific, most reliable source down to a last-resort guess — for POSIX shells and PowerShell.
-
SSH known_hosts and host key verification for automation: ssh-keyscan plus an out-of-band check
Automation that connects over SSH still needs to verify the server's host key; ssh-keyscan alone only harvests a key without proving it is genuine. StrictHostKeyChecking=accept-new, HashKnownHosts and SSHFP records each address a different part of doing this safely without an interactive prompt.
-
Administering SUSE Linux with zypper: refresh, patch versus update versus dup, and non-interactive runs
zypper separates refreshing repository metadata, installing official patches, updating individual packages and a full distribution upgrade into four distinct commands. Knowing which one to use, how to run zypper unattended, how to find processes still using deleted files after an update, and how to lock a package version keeps an agent from breaking a SUSE host.
-
The PF firewall on FreeBSD: testing pf.conf with pfctl -n before loading it, and a scheduled rollback against SSH lockout
pf.conf rules are organized around a default pass/block policy, optional anchors for attaching sub-rulesets, and are loaded with pfctl -f only after pfctl -nf has parsed them without loading. Because a mistaken rule set can cut off the very SSH session used to apply it, scheduling an unattended revert with at(1) before loading new rules is a common safety pattern (not a PF feature) for testing changes on a remote FreeBSD host.
-
Running apt and dpkg non-interactively on Debian and Ubuntu without hanging on prompts
A scripted apt-get or dpkg run can stall on a debconf prompt, a modified-conffile question or a held dpkg lock. Setting DEBIAN_FRONTEND, the right confold/confdef options and preseeding debconf answers first turns an install into a command that either finishes or fails loudly.
-
Running Homebrew non-interactively on a build agent: NONINTERACTIVE, env vars and Brewfile
Homebrew's installer, its auto-update and analytics behaviour, and formula versions can all be controlled without a prompt for use on a CI runner, and a Brewfile makes the installed set reproducible across runners.
-
Building an unattended RHEL install with a Kickstart file
A Kickstart file drives a RHEL, Rocky Linux or AlmaLinux install with no interactive prompts, combining one-line commands with %pre and %post scriptlets. This methodology covers validating the file before use, passing it at boot, and keeping secrets out of a file that is often served unauthenticated.
-
Configuring unattended-upgrades for automatic security patching on Debian and Ubuntu
unattended-upgrades applies package updates on a timer using two files: 20auto-upgrades (whether and how often) and 50unattended-upgrades (which origins and whether to reboot). Testing with --dry-run --debug before enabling it in production avoids surprise reboots or half-applied upgrades.
Legível por máquina: JSON