1ASTRIBANK_IS_STARTING(8)                              ASTRIBANK_IS_STARTING(8)
2
3
4

NAME

6       astribank_is_starting  -  Mark  /  check is a Xorcom Astribank (xpp) is
7       starting
8

SYNOPSIS

10       astribank_is_starting [-d] [-v] [-t timeout] <-a|-r|-w>
11
12       astribank_is_starting [-d] [-v]
13
14       astribank_is_starting -h
15
16

DESCRIPTION

18       astribank_is_starting is an internal tool used by various  xpp  scripts
19       to  mark  that there may be an Astribank device currently initializing,
20       and to check for that mark.
21
22       Technically the mark is a SysV semaphore.
23
24

OPTIONS

26       -a
27              Add.  Set the mark. Should return 0 unless there's an error.
28
29       -r
30              Remove.  Reset the mark.  Should  return  0  unless  there's  an
31              error.
32
33       -ttimeout
34              Timeout.  Set the timeout value for the -w option. Default is 60
35              seconds.
36
37       -w
38              Wait.  Wait for mark to be reset. Should return 0 unless there's
39              an error.
40
41       Without  -a  or  -r:  return  0 if the mark has been set, or a non-zero
42       value otherwise.
43
44       -d
45              Print debug information to stderr.
46
47       -v
48              Verbose execution.
49
50       -h
51              Displays usage message.
52
53

FILES

55       /proc/sysvipc/sem
56              If set, the astribank should appear there with the  ID  11211168
57              (0xAB11A0).   Naturally  the ID (or rather, the usage of a sema‐
58              phore in the first place) is an implementation detail  that  may
59              change.
60
61

NOTES

63       astribank_is_starting is used to mark the fact that an Astribank may be
64       currently reenumerating (technically: distonnecting and connecting as a
65       new  USB device) after loading the firmware. Thus the script that loads
66       the firmware (/usr/share/dahdi/xpp_fxloader) uses this utility  to  set
67       the mark.
68
69       The mark is reset by /usr/share/dahdi/waitfor_xpds , which is typically
70       run by the DAHDI init script and waits for  all  Astribanks  to  finish
71       loading.
72
73       Q: Why do you use a semaphore?
74
75       A: because, unlike the filesystem, it is writable at any given time.
76
77

BUGS

79       Option  ordering  matter.  The  -v  and  -d  options should preceed the
80       actions (-a, -r and -w).  The -ttimeout option should  preceed  the  -w
81       option.
82
83

SEE ALSO

85       semctl(3)
86
87

AUTHOR

89       This  manual  page  was  written  by  Tzafrir Cohen <tzafrir.cohen@xor‐
90       com.com> .  Permission is granted to  copy,  distribute  and/or  modify
91       this  document  under the terms of the GNU General Public License, Ver‐
92       sion 2 any later version published by the Free Software Foundation.
93
94       On Debian systems, the complete text of the GNU General Public  License
95       can be found in /usr/share/common-licenses/GPL.
96
97
98
99                                16 August 2009        ASTRIBANK_IS_STARTING(8)
Impressum