Skip to main content
19 votes
Accepted

What is OpenBSD's pledge in short?

What is Pledge? pledge is a system call. Calling pledge in a program is to promise that the program will only use certain resources. Another way of saying is to limit the operation of a program ...
arif's user avatar
  • 1,479
19 votes
Accepted

Equivalent to "source" in OpenBSD?

You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The ...
JdeBP's user avatar
  • 68.9k
16 votes
Accepted

How to enable pkg_add for OpenBSD

On 6.0 and below, add a mirror to the file /etc/pkg.conf: installpath = http://ftp.eu.openbsd.org/pub/OpenBSD/5.9/packages/amd64/ On 6.1 and later, use the file /etc/installurl: https://ftp.eu....
Rufo El Magufo's user avatar
14 votes
Accepted

OpenBSD 6.0 ntpctl says "clocked synced" but is ~26 seconds behind

OpenBSD and your VM are working right; you are mis-using the Google time source. This is in the OpenBSD Frequently Asked Questions and manual pages. You are synchronizing to a time source that ...
JdeBP's user avatar
  • 68.9k
13 votes

Prevent a USB external hard drive from sleeping

Just my 2 cents... It is more than true that spinning down the disks decreases their service life. Years of experience have shown that starting and stopping the disk motor causes far more fatigue ...
Erebus's user avatar
  • 131
13 votes
Accepted

Bounds in awk regular expression do not work on OpenBSD

That restriction is precisely documented. From: http://man.openbsd.org/awk.1#STANDARDS STANDARDS The awk utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification, except awk does ...
Paul_Pedant's user avatar
  • 8,696
12 votes
Accepted

OpenBSD: How to follow -current?

Don't build from source. I've been following current for several years. You can do binary upgrades to new snapshots. And you can do a direct binary upgrade from release/stable to current. Reboot. At ...
Ben M.'s user avatar
  • 323
12 votes
Accepted

How come I can't use `\` to continue a line in crontab?

There is no way to split a single command line onto multiple lines, like the shell's trailing "\" You'll find the above statement in the following paragraph if you do man 5 crontab. Please ...
SparedWhisle's user avatar
  • 3,668
10 votes

Prevent a USB external hard drive from sleeping

I have found that the following cronjob works for me. */5 * * * * /bin/touch /dev/sdb &>/dev/null Obviously update it with the device name of your disk. You can also vary the time based on how ...
Steven's user avatar
  • 101
10 votes
Accepted

OpenBSD: Defining a new loopback interface

As hinted at in lo(4), you may create /etc/hostname.lo1: inet 127.0.0.2 255.0.0.0 This will create the lo1 interface when the boot process runs /etc/netstart. With that file in place, you may also ...
Kusalananda's user avatar
  • 335k
10 votes

Equivalent to "source" in OpenBSD?

The source keyword which is available in bash is not part of the Posix standard. Instead you can use . myVenv/bin/activate You could use the same syntax with . in bash which you are using on your ...
Bodo's user avatar
  • 6,078
10 votes
Accepted

No gcc executable after pkg_add gcc on OpenBSD

The GNU C compiler executable is called egcc when it's installed from the gcc package. There should also be a gcc executable in /usr/bin (the gcc of the base system, at least on amd64). $ type egcc ...
Kusalananda's user avatar
  • 335k
9 votes

Are there any virtualization solutions for OpenBSD that aren't from ports?

There is now vmm, which is OpenBSD's builtin virtualization solution. It is fully supported and probably the fastest solution on OpenBSD.
sww1235's user avatar
  • 95
8 votes

nginx: Long filenames in directory listing

You can try fancyindex module with its fancyindex_name_length parameter to configure the filename length.
Jack Rowe's user avatar
8 votes

OpenBSD 6.1 not updating

I just wanted to add that you will get the same error message if your system time is off. I got the same error, tried using a mirror as Kusalananda suggested but still had SSL errors. I checked the ...
sheepdog's user avatar
  • 233
8 votes
Accepted

List all connected devices in OpenBSD

The sysctl command can list devices attached to the system. sysctl gets or sets kernel state. To list how many disks you have: sysctl hw.diskcount To list disk names: sysctl hw.disknames Or ...
fcbsd's user avatar
  • 689
8 votes

How to properly enable httpd with rcctl on OpenBSD so that it starts automatically?

Your issue was that the httpd daemon was given an invalid command line argument (the string YES) when started using rcctl and therefore would not start properly. The only "special" value ...
Kusalananda's user avatar
  • 335k
8 votes
Accepted

Script or makefile to automate new user creation?

I strongly suggest to use a script and not a makefile. The reasons are, in short: adhering to common practice. or the principle of least astonishment. maintainability and extensibility. and the fact ...
Lesmana's user avatar
  • 27.5k
8 votes

Packaging binary release on OpenBSD

The information you need is available in the Porter's Handbook (more specifically the Porting Guide therein). The summary is that you (if you want to create an official OpenBSD port) would not create ...
Kusalananda's user avatar
  • 335k
7 votes
Accepted

OpenBSD - Reduce the Base Install Size for Smaller Systems

The good news is it can be done, but you'll need to know what you're doing and you won't be able to ask for any help on the openbsd mailing lists. You'll need: a more powerful build machine then ...
user2001002's user avatar
7 votes

Is there a valid alternative to top for OpenBSD?

Htop 2.0 adds OpenBSD support. I just compiled it on OpenBSD 5.9 and it works very well: http://hisham.hm/htop/
mntmn's user avatar
  • 71
7 votes

Prevent a USB external hard drive from sleeping

I see citations and questions, but not any direct suggestions for syntax, so adding in my answer despite one being accepted. The command(s) for elegantly de-activating sleep with hdparm (as requested)...
oemb1905's user avatar
  • 178
6 votes

Why is cut not cutting at the right column?

You've got tabs in there; each tab counts as one character from cut's point of view, but can occupy more space than that onscreen. What's more, it occupies an amount which varies depending on where in ...
Stephen Kitt's user avatar
6 votes
Accepted

OpenBSD 6.1 not updating

This is likely a temporary issue, I can reproduce it. The mirror that I'm using, https://ftp.eu.openbsd.org/pub/OpenBSD, works as expected. Someone reported this to the openbsd-misc mailing list. A ...
Kusalananda's user avatar
  • 335k
6 votes

What is OpenBSD's pledge in short?

A program normally makes use of only a certain set of system or library calls. With pledge you can restrict the set of allowed system calls to only this set. For example, if a program does not need to ...
Johan Myréen's user avatar
6 votes
Accepted

How install packages in OpenBSD snapshot?

Install packages with pkg_add as usual, but use -D snapshot (or just -D snap) to make it look in the correct place on your selected mirror (the mirror listed in /etc/installurl). So, to install ...
Kusalananda's user avatar
  • 335k
6 votes
Accepted

openbsd installer doesn't recognize disks?

As Ze Loff told in a comment, it was the SATA controller setting in Bios. The default was using RAID. I changed it to using AHCI. After that, the kernel detected all drives as the bootloader.
cul8er's user avatar
  • 339
6 votes
Accepted

What are the daemon user and group for?

They are legacy thing ; daemon user & group are respectively unprivileged meant to be used by multiple applications to get restricted access to the system. Now days you should use a dedicated user ...
Reda Salih's user avatar
  • 1,754

Only top scored, non community-wiki answers of a minimum length are eligible