Next: , Previous: , Up: mgetty   [Contents]


2.5 Denying logins

If you want to prevent mgetty from accepting calls, you can do so by creating a file called /etc/nologin.<device> (e.g. /etc/nologin.tty2a). If mgetty detects an incoming call, and sees this file, it will NOT answer the phone. This way the caller does not lose money for a useless call when logins are not allowed anyway. (You can change the filename that is checked by changing NOLOGIN_FILE in policy.h)

This can be used for quite sophisticated scheduling purposes - imagine a modem attached to a line used for voice during the daytime. So, you want the modem only to answer the phone during 9 pm and 7 am. What you do is to have cron create a /etc/nologin.device file at 7 am (so the modem won’t answer the call during the day) and remove it at 9 pm (so the modem can answer the phone at night).

Naturally, this can be easily extended - e.g., answer the phone only on weekends (similar cron job), don’t answer the phone if there are less than 5 Mbyte free on disk (have a process check for free disk space regularily and create /etc/nologin.* file(s) accordingly), …