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 to its ...
arif's user avatar
  • 1,599
18 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
  • 71.9k
14 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,914
13 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
  • 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
  • 9,414
13 votes

What exactly is a scratch file (starting with #)? Does it still work today?

Now I never heard of a scratch file. Is this a long forgotten thing? Does it still work today? Is it just disabled? When will it get deleted (couple days?)? by what (cron?)? Automatic deletion of ...
grawity's user avatar
  • 15.2k
11 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
  • 313
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,441
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
  • 356k
9 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
  • 198
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

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

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
  • 356k
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
  • 28.1k
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
  • 356k
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
  • 356k
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

cut now has a line length limitation?

compliant with the IEEE Std 1003.1-2008 ("POSIX.1") specification This specification of cut (as well as newer ones) says: The input files shall be text files, except that line lengths ...
Kamil Maciorowski's user avatar
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,812
6 votes
Accepted

Error: "failed to preserve ownership" when trying to move files to a FAT32 partition on OpenBSD

The message failed to preserve ownership for '/mnt2/iwn-firmwae.tgz': Operation not permitted is more of a warning than an error. The files copied successfully, but permissions and ownership of the ...
user10489's user avatar
  • 10.9k
6 votes
Accepted

How to launch my web application on startup? OpenBSD

If you don't want to use the rc.d infrastructure (you should), you can just add whatever is appropriate to /etc/rc.local BUT remember that everything there is run as root, so you'll probably want to ...
Zé Loff's user avatar
  • 2,322
6 votes

What exactly is a scratch file (starting with #)? Does it still work today?

Scratch files were introduced for passes on a PDP 11 and later on large UCB systems which had a /tmp like disk which was being cleared on reboot and later for prod uses every day with a cron like ...
Tch's user avatar
  • 171
6 votes

OpenBSD 7.7 mips64el pre-built packages

There does not seem to exist official ready-built packages for mips64el, and although the architecture is officially supported by the OpenBSD people, packages would need to be built locally, from the ...
Kusalananda's user avatar
  • 356k
5 votes

Why can't I use sudo on OpenBSD?

OpenBSD 5.8 or later comes with doas instead of sudo (which remains available as a package), and by default it's not configured to let you run things. Create file /etc/doas.conf and add to it: permit ...
user3486184's user avatar
5 votes
Accepted

What does *.* stand for in "Local Address" of a netstat result?

It's an unspecified or wildcard port (or address); from netstat(1) Unspecified or “wildcard” addresses and ports appear as a single ‘*’ So *.514 is syslog per /etc/services listening for connections ...
thrig's user avatar
  • 35.8k

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