FAQ Database Discussion Community


dot command (.) not found on FreeBSD 9.3

linux,shell,freebsd
On FreeBSD 9.3, I tried to used the dot command (.) on the root user ([email protected]#) but I received the following error: > .: Command not found. However, as a 'non-root` (#) user it works fine! What is going on? $PATH - i point to /root and now ,i test...

Using GridFS with official C# driver in MonoDevelop

c#,mongodb,monodevelop,mongodb-csharp,freebsd
I am using MonoDevelop on PC-BSD 10.1 and working with MongoDB 3.2. I downloaded MongoDB.Driver (+Bson& Core) from Nuget. I can do basic reads and writes and was trying to get GridFS working by following what seems to be the most current example from StackOverflow: MongoDB GridFs with C#, how...

Python Script monitor for file change

python,file,freebsd
I want to run a little python script on my Freenas inside a Jail. The script should watch out for a file. If this file is changed. It should do something. So my question is what is the mechanism which allows me to monitor a file and run a method...

How to trace system calls in FreeBSD from source code?

freebsd,system-calls,syscall,truss
How to log system calls (the syscall number and the return value, for both int 0x80 and sysenter/syscall) on FreeBSD 10.1 x86_64 from source code? I know truss can do the work, but I need to log other information like the buffer of copyout during each system call. I tried...

Any variant to run android emulator without kvm support?

android,freebsd
Since last update, android emulator refuses to run on a machine without KVM support. Is there any way to get older emulator version to run Emulator w/o he emulation? Which was this version?

Mounting GEOM_ELI Encrypted ZFS Pool as root

unix,encryption,freebsd,boot,zfs
I have a 3 Disk RAIDz1 Pool, encrypted with AES128 in GEOM_ELI, that I have been using in FreeNAS since version 8. There have been many zpool upgrades, and over all I am very happy with ZFS. Lately however I have been growing frustrated with FreeNAS. Largely many bugs that...

Implementation of copyout() in FreeBSD

unix,freebsd,bsd,netbsd
Where is the definition of function copyout() in FreeBSD for AMD64? (http://www.unix.com/man-page/FreeBSD/9/copyout/) The only place I can find is in sys/sys/systm.h. The definition/declaration is: int copyout(const void * __restrict kaddr, void * __restrict udaddr, size_t len) __nonnull(1) __nonnull(2); Is it a declaration or a definition? What does __nonnull(1) and __nonnull(2)...

How to restore ntfs partition table in freebsd

freebsd,data-recovery
I accidentally deleted my partition table(MBR + NTFS) on my old disk through: gpart delete -i ada3 gpart destory ada3 Which contains all files on it. How can I restore these data on this disk? ...

Rails does not reload controllers, helpers on each request in FreeBSD 9.1

ruby-on-rails,ruby-on-rails-4,freebsd,ruby-on-rails-4.2
I've detected weird behavior of rails. Please give me some advice! For example I have a code like this: def new raise end I start rails server in development mode. Hit refresh in browser and see RuntimeError in AuthenticationController#new Okay. I comment out line with "raise" like this: def #...

How can I increase the MAX_PATH_LENGTH in a freeBSD system?

linux,filesystems,freebsd,system-calls
I am writing a 'find' like utility to search some particular files in a freebsd based system. The stat() call in freeBSD 9 can accept paths with length 1024 chars, though linux supports upto 4K char paths. The system itself has a filesystem other than freeBSD's (its a commercial OS)...

How to know the address range of kernel stack in user process and kernel thread?

stack,kernel,freebsd
I'd like to know the address range of kernel stack. For user-space process, we can use /proc/pid/maps to see the stack address range by keyword [stack], but do not know which one is kernel stack. For kernel thread, usually /proc/pid/maps is empty. So how can I know the kernel stack...

Timer in FreeBSD kernel module?

timer,kernel,freebsd,kernel-module,callout
I'd like to let my kernel module periodically do something (a certain time interval, like 10 sec) in FreeBSD kernel. Any example for doing that? I searched and found that there are functions like callout/timeout(old), but they seem complicated, and I cannot find good examples for them. For callout'', it...

Generic Makefile not working on FreeBSD

makefile,make,freebsd,cc
Please note that this is not a duplicate of the other questions named generic makefile. I have followed all of the instructions on other questions about generic makefiles, and this is the code I have come up with from that: CFLAGS = -c CC = cc SOURCES = $(wildcard *.cc)...

Launch FreeBSD 8.4 (and newer) under qemu/kvm

freebsd,qemu,kvm
I'm trying to launch FreeBSD releases since 6.0 and never in virtual machines, using qemu-2.0.0+dfsg-2ubuntu1.10 (qemu-kvm) and virt-manager-1:1.1.0-1~getdeb3. All releases under 8.4 (and also 9.0) runs fine with the same settings of vm, but I can't launch 8.4+ (9.1+): they go into loop just after some seconds after boot starts....

Does kernel have its own stack (not kernel thread)? And how to read the `vm_map` structure of kernel in FreeBSD?

memory,memory-management,kernel,driver,freebsd
I need to find all the kernel-owned memory regions under FreeBSD x86_64. One option is to traverse vm_map_entry and find the start_addr and end_addr as K0-K1, K2-K3, K4-K5, K7-K8. As I noticed, there is no stack in these areas. I believe kernel has a very limited stack, but how to...

Use Fossil for system files?

unix,freebsd,fossil
As a new user of Fossil, I'm curious if there are any negative implications with using Fossil to store things like /etc/, /usr/local/etc files from Unix like systems like FreeBSD & OpenBSD. If I'm doing this for multiple systems, I think I'd create a branch with each hostname to track...

How to check whether the system is FreeBSD in a python script?

python,python-2.7,freebsd
I would like to add a check in a python 2.7.x script in the form of if __check_freebsd__(): # run actions which would only work on FreeBSD (e.g. create a jail) elif __check_debian__(): # run an alternative that runs on Debian-based systems else: raise Error("unsupported OS") How would the __check_freebsd__...

how to use emacs tramp with ssh remote to server

emacs,sftp,freebsd
I want use emacs remote server(freebsd use sftp with ssh). I already read this and write (require 'tramp) (setq tramp-default-method "ssh") in my .emacs. I use C-c C-f RET /sftp:[email protected]/. But it does not work

Force unlock a mutex that was locked by a different thread

c,multithreading,pthreads,freebsd
Consider the following test program: #include <stdio.h> #include <string.h> #include <errno.h> #include <strings.h> #include <unistd.h> #include <signal.h> #include <pthread.h> pthread_mutex_t mutex; pthread_mutexattr_t mattr; pthread_t thread1; pthread_t thread2; pthread_t thread3; void mutex_force_unlock(pthread_mutex_t *mutex, pthread_mutexattr_t *mattr) { int e; e = pthread_mutex_destroy(mutex); printf("mfu: %s\n", strerror(e)); e = pthread_mutex_init(mutex, mattr); printf("mfu: %s\n",...

How to get a path from an inode on FreeBSD (ZFS and UFS)?

freebsd,bsd,inode,zfs
Windows (NtQueryObject), Linux (/proc/self/fd/x) and OS X (F_GETPATH) all have methods for retrieving the path of a currently open file descriptor. Supposedly so does FreeBSD via something like the following code: size_t len; int mib[4]={CTL_KERN, KERN_PROC, KERN_PROC_FILEDESC, getpid()}; BOOST_AFIO_ERRHOS(sysctl(mib, 4, NULL, &len, NULL, 0)); std::vector<char> buffer(len*2); BOOST_AFIO_ERRHOS(sysctl(mib, 4, buffer.data(), &len,...

error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

freebsd,authorize.net,sha256
I have a FreeBSD server FreeBSD hotspot.brightlan.net 6.2-RELEASE-p6 FreeBSD 6.2-RELEASE-p6 #0: Sat Jul 21 13:42:25 EDT 2007 On this server I have an application in php using curl which connects to Authorize.net through their api. Recently they updated their SSL certificates to support sha256 and hence the SSL certificate also...

Get user's home folder under Python process started by supervisord

python,django,freebsd,supervisord
I would like to store login secrets in a file from the current user's account in a Django configuration. I'm using the recommended portable way to get the home folder, as in: os.path.expanduser("~") This worked in all environments, both locally and both when started with gunicorn -D config.wsgi on a...

How to link kernel functions to user-space program?

linux,linker,kernel,freebsd,static-linking
I have a user-space program (Capstone). I would like to use it in FreeBSD kernel. I believe most of them have the same function name, semantics and arguments (in FreeBSD, the kernel printf is also named printf). First I built it as libcapstone.a library, and link my program with it....

Where is TCB located on FreeBSD?

multithreading,process,operating-system,freebsd,netbsd
Where is the kernel thread control block (TCB) located On FreeBSD? (After the thread is interrupted, where is the context (containing %RIP/%EIP) saved?) Is it on the kernel stack or somewhere else? In FreeBSD, are process and thread quite similar, like on Linux, or totally different abstractions?...

Nginx password on FreeNAS (FreeBSD) htpasswd

nginx,freebsd,.htpasswd
I have nginx running on FreeNAS in a jail in front of various plugins like transmission, couchpotato, etc. As far as I know FreeNAS is based on FreeBSD. I'd like to expose this server to the outside world, but can't work out how to set a password on nginx, as...

Dovecot process limits

freebsd,dovecot
Sometimes my dovecot log return: service(imap-login): process_limit (512) reached, client connections are being dropped I can increase process_limit in dovecot config file, but i dont understand, how will it affect the system. How to diagnose why process limit is too high? I have around 50 users in my postfix+dovecot+roundcube system....