aboutsummaryrefslogtreecommitdiff
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* Changed "conscontrol unset" to accept an existing virtualRuslan Ermilov2011-04-182-24/+12
| | | | | | | | | | console device as an argument. Unsetting virtual console using /dev/console seems to have never worked. MFC after: 3 days Notes: svn path=/head/; revision=220801
* Remove hast_proto_recv(). It was used only in one place, whereMikolaj Golub2011-04-173-21/+1
| | | | | | | | | | | hast_proto_recv_hdr() may be used. This also fixes the issue (introduced by r220523) with hastctl, which crashed on assert in hast_proto_recv_data(). Suggested and approved by: pjd (mentor) Notes: svn path=/head/; revision=220744
* If we can retrieve interface address sleep for one second and try again.Maxim Sobolev2011-04-171-9/+29
| | | | | | | | | | This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. MFC after: 2 weeks Notes: svn path=/head/; revision=220736
* Remove vestiges of disklabel(5).Sergey Kandaurov2011-04-141-3/+1
| | | | | | | | Reviewed by: uqs MFC after: 5 days Notes: svn path=/head/; revision=220617
* The replication mode that is currently support is fullsync, not memsync.Pawel Jakub Dawidek2011-04-121-1/+8
| | | | | | | | | | Correct this and print a warning if different replication mode is configured. MFC after: 1 week Notes: svn path=/head/; revision=220573
* In hast_proto_recv() remove unnecessary check. The size is checkedMikolaj Golub2011-04-101-6/+1
| | | | | | | | | | later in hast_proto_recv_data(). Approved by: pjd (mentor) MFC after: 1 week Notes: svn path=/head/; revision=220523
* In hast_proto_recv_data() check that the size of the data to beMikolaj Golub2011-04-101-2/+5
| | | | | | | | | | received does not exceed the buffer size. Approved by: pjd (mentor) MFC after: 1 week Notes: svn path=/head/; revision=220522
* Fix a typo in comments.Mikolaj Golub2011-04-101-1/+1
| | | | | | | | Approved by: pjd (mentor) MFC after: 3 days Notes: svn path=/head/; revision=220521
* hastd(8) maintains a map of dirty extents, not hastctl(8). Fix this.Mikolaj Golub2011-04-101-2/+2
| | | | | | | | Approved by: pjd (mentor) MFC after: 3 days Notes: svn path=/head/; revision=220520
* Correct 'list scan' description in the examples. The previous descriptionGlen Barber2011-04-061-1/+1
| | | | | | | | | | | | was incorrect - 'list scan' does not actually do a scan, but instead lists the results of the background 'scan' cache. Submitted by: Fabian Keil (freebsd-listen of fabiankeil de) (via email) Discussed with: bschmidt MFC after: 3 days Notes: svn path=/head/; revision=220382
* * Add the readline(3) API to libedit. The libedit versions ofDavid E. O'Brien2011-04-052-3/+4
| | | | | | | | | | | | | | | | | | | {readline,history}.h are in /usr/include/edit so as to not conflict with the GNU libreadline versions. To use the libedit readline(3) one should add "-I/usr/include/edit" to their Makefile (spelled "-I${DESTDIR}/${INCLUDEDIR}/edit" within the FreeBSD source tree). * Enable its use in the BSD licensed utilities that support readline(3). * To make it easier to sync libedit development with NetBSD, histedit.h is moved into libedit's directory as history shows shown we keep merging it into that location. Obtained from: NetBSD Sponsored by: Juniper Networks Notes: svn path=/head/; revision=220370
* Increase default timeout from 5 seconds to 20 seconds. 5 seconds is definitelyPawel Jakub Dawidek2011-04-022-3/+3
| | | | | | | | | | to short under heavy load and I was experiencing those timeouts in my recent tests. MFC after: 1 week Notes: svn path=/head/; revision=220274
* Handle ENOBUFS on send(2) by retrying for a while and logging the problem.Pawel Jakub Dawidek2011-04-021-0/+22
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=220273
* When we are operating on blocking socket and get EAGAIN on send(2) or recv(2)Pawel Jakub Dawidek2011-04-021-4/+35
| | | | | | | | | | | this means that request timed out. Translate the meaningless EAGAIN to ETIMEDOUT to give administrator a hint that he might need to increase timeout in configuration file. MFC after: 1 month Notes: svn path=/head/; revision=220272
* Declare directions for sockets between primary and secondary.Pawel Jakub Dawidek2011-04-022-0/+12
| | | | | | | | | | In HAST we use two sockets - one for only sending the data and one for only receiving the data. MFC after: 1 month Notes: svn path=/head/; revision=220271
* Allow to disable sends or receives on a socket using shutdown(2) byPawel Jakub Dawidek2011-04-021-0/+22
| | | | | | | | | | interpreting NULL 'data' argument passed to proto_common_send() or proto_common_recv() as a will to do so. MFC after: 1 month Notes: svn path=/head/; revision=220270
* Handle the problem described in r220264 by using GEOM GATE queue of unlimitedPawel Jakub Dawidek2011-04-021-1/+1
| | | | | | | | | length. This should fix deadlocks reported by HAST users. MFC after: 1 week Notes: svn path=/head/; revision=220266
* Because ggatel(8) operates on local GEOM providers, use unlimited queue size inPawel Jakub Dawidek2011-04-022-18/+4
| | | | | | | | | GEOM GATE to fix the issue described in r220264. This also means that we no longer need -q option, remove it. Don't bother to leaving it as a no-op, as ggatel(8) is just an example utility. Notes: svn path=/head/; revision=220265
* Add mapsize to the header just before sending the packet.Pawel Jakub Dawidek2011-03-251-1/+1
| | | | | | | | | | | | Before it could change later and we were sending invalid mapsize. Some time ago I added optimization where when nodes are connected for the first time and there were no writes to them yet, there is no initial full synchronization. This bug prevented it from working. MFC after: 1 week Notes: svn path=/head/; revision=220007
* Use timeout from configuration file not only when sending and receiving,Pawel Jakub Dawidek2011-03-251-1/+1
| | | | | | | | | but also when establishing connection. MFC after: 1 week Notes: svn path=/head/; revision=220006
* Use role2str() when setting process title.Pawel Jakub Dawidek2011-03-252-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=220005
* MFgraid/head:Alexander Motin2011-03-244-0/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new RAID GEOM class, that is going to replace ataraid(4) in supporting various BIOS-based software RAIDs. Unlike ataraid(4) this implementation does not depend on legacy ata(4) subsystem and can be used with any disk drivers, including new CAM-based ones (ahci(4), siis(4), mvs(4), ata(4) with `options ATA_CAM`). To make code more readable and extensible, this implementation follows modular design, including core part and two sets of modules, implementing support for different metadata formats and RAID levels. Support for such popular metadata formats is now implemented: Intel, JMicron, NVIDIA, Promise (also used by AMD/ATI) and SiliconImage. Such RAID levels are now supported: RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. For any all of these RAID levels and metadata formats this class supports full cycle of volume operations: reading, writing, creation, deletion, disk removal and insertion, rebuilding, dirty shutdown detection and resynchronization, bad sector recovery, faulty disks tracking, hot-spare disks. For Intel and Promise formats there is support multiple volumes per disk set. Look graid(8) manual page for additional details. Co-authored by: imp Sponsored by: Cisco Systems, Inc. and iXsystems, Inc. Notes: svn path=/head/; revision=219974
* MFgraid/head r217014:Alexander Motin2011-03-242-42/+161
| | | | | | | | | | | Make `geom XXX list` and `geom XXX status` outputs more consistent: Add -a options to print all geoms, not only ones with providers. Add -g option for `status` to report geom's names, not provider's. Make `status` by default report provider's status (if present), not geom's. Make `status` report consumer's statuses, not only "synchronized" field. Notes: svn path=/head/; revision=219969
* It's possible to unmount multiple items at once, make it clear.Ruslan Ermilov2011-03-242-2/+2
| | | | Notes: svn path=/head/; revision=219955
* Fix SYNOPSIS.Gleb Smirnoff2011-03-231-1/+1
| | | | Notes: svn path=/head/; revision=219904
* Don't create socketpair for connection forwarding between parent and secondary.Pawel Jakub Dawidek2011-03-232-20/+28
| | | | | | | | | Secondary doesn't need to connect anywhere. MFC after: 1 week Notes: svn path=/head/; revision=219900
* Add support for displaying newfs flags for SU+J and TRIM.Juli Mallett2011-03-231-1/+5
| | | | Notes: svn path=/head/; revision=219899
* Add my copyright.Pawel Jakub Dawidek2011-03-222-0/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219887
* Forgot to commit this as part of r219873.Pawel Jakub Dawidek2011-03-221-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219884
* After synchronization is complete we should make primary counters beMikolaj Golub2011-03-221-3/+3
| | | | | | | | | | | | | | | | equal to secondary counters: primary_localcnt = secondary_remotecnt primary_remotecnt = secondary_localcnt Previously it was done wrong and split-brain was observed after primary had synchronized up-to-date data from secondary. Approved by: pjd (mentor) MFC after: 1 week Notes: svn path=/head/; revision=219882
* For requests that are sent only to remote component use theMikolaj Golub2011-03-221-2/+7
| | | | | | | | | error from remote. Approved by: pjd (mentor) MFC after: 1 week Notes: svn path=/head/; revision=219879
* The proto API is a general purpose API, so don't use 'hast' in structures orPawel Jakub Dawidek2011-03-227-118/+120
| | | | | | | | | function names. It can now be used outside of HAST. MFC after: 1 week Notes: svn path=/head/; revision=219873
* White space cleanups.Pawel Jakub Dawidek2011-03-227-18/+18
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219864
* When dropping privileges prefer capsicum over chroot+setgid+setuid.Pawel Jakub Dawidek2011-03-215-6/+19
| | | | | | | | | | | | We can use capsicum for secondary worker processes and hastctl. When working as primary we drop privileges using chroot+setgid+setuid still as we need to send ioctl(2)s to ggate device, for which capsicum doesn't allow (yet). X-MFC after: capsicum is merged to stable/8 Notes: svn path=/head/; revision=219847
* Initialize localcnt on first write. This fixes assertion when we createPawel Jakub Dawidek2011-03-211-2/+6
| | | | | | | | | | resource, set role to primary, do no writes, then sent it to secondary and accept connection from primary. MFC after: 1 week Notes: svn path=/head/; revision=219844
* Fix typo.Pawel Jakub Dawidek2011-03-211-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219843
* Before handling any events on descriptors check signals so we can updatePawel Jakub Dawidek2011-03-211-28/+43
| | | | | | | | | | | | | | | | | our info about worker processes if any of them was terminated in the meantime. This fixes the problem with 'hastctl status' running from a hook called on split-brain: 1. Secondary calls a hooks and terminates. 2. Hook asks for resource status via 'hastctl status'. 3. The main hastd handles the status request by sending it to the secondary worker who is already dead, but because signals weren't checked yet he doesn't know that and we get EPIPE. MFC after: 1 week Notes: svn path=/head/; revision=219837
* Bump date from previous commit.Glen Barber2011-03-211-1/+1
| | | | Notes: svn path=/head/; revision=219834
* Remove stale comment. Yes, it is valid to set role back to init.Pawel Jakub Dawidek2011-03-211-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219833
* Increase debug level of "Checking hooks." message.Pawel Jakub Dawidek2011-03-211-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219832
* Be pedantic and free nvout before exiting.Pawel Jakub Dawidek2011-03-211-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219831
* Detect situation where resource internal identifier differs.Pawel Jakub Dawidek2011-03-211-0/+13
| | | | | | | | | | This means that both nodes have separately managed resources that don't have the same data. MFC after: 1 week Notes: svn path=/head/; revision=219830
* Forgot to commit this as a part of r219818.Pawel Jakub Dawidek2011-03-211-1/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219821
* In hast.conf we define the other node's address in 'remote' variable.Pawel Jakub Dawidek2011-03-2114-36/+124
| | | | | | | | | | | | | | | | | | | | | This way we know how to connect to secondary node when we are primary. The same variable is used by the secondary node - it only accepts connections from the address stored in 'remote' variable. In cluster configurations it is common that each node has its individual IP address and there is one addtional shared IP address which is assigned to primary node. It seems it is possible that if the shared IP address is from the same network as the individual IP address it might be choosen by the kernel as a source address for connection with the secondary node. Such connection will be rejected by secondary, as it doesn't come from primary node individual IP. Add 'source' variable that allows to specify source IP address we want to bind to before connecting to the secondary node. MFC after: 1 week Notes: svn path=/head/; revision=219818
* Log when we start hooks checking and when we execute a hook.Pawel Jakub Dawidek2011-03-211-0/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219817
* Use snprlcat() instead of two strlcat(3)s.Pawel Jakub Dawidek2011-03-211-2/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=219816
* Add snprlcat() and vsnprlcat() - the functions I'm always missing.Pawel Jakub Dawidek2011-03-212-0/+27
| | | | | | | | | | They work as a combination of snprintf(3) and strlcat(3) - the caller can append a string build based on the given format. MFC after: 1 week Notes: svn path=/head/; revision=219815
* When creating connection on behalf of primary worker, set pjdlog prefixPawel Jakub Dawidek2011-03-211-0/+4
| | | | | | | | | | to resource name and role, so that any logs related to that can be identified properly. MFC after: 1 week Notes: svn path=/head/; revision=219814
* If there is any traffic on one of out descriptors, we were not checking forPawel Jakub Dawidek2011-03-211-2/+14
| | | | | | | | | | long running hooks. Fix it by not using select(2) timeout to decide if we want to check hooks or not. MFC after: 1 week Notes: svn path=/head/; revision=219813
* Use 'list scan' in favor of 'scan', as 'scan' has a different purpose.Glen Barber2011-03-201-1/+1
| | | | | | | | Pointed out by: bschmidt MFC after: 1 day Notes: svn path=/head/; revision=219805