This article is intended for enterprise and education system administrators.
Your Mac determines how each window and its contents should appear by collecting file information such as labels, tags, and other forms of metadata.
Central printer management Advanced file serving features, such as making use of Virtual File System (VFS) plugins. Samba is a cross-platform triumph: robust, flexible and fast, it turns a Unix or Linux system into a file and print server for Microsoft Windows network clients. Printer and scanner drivers for Mac If you have an older printer that doesn't support driverless technology, your Mac might automatically install the driver software needed to use that device. Many printers and scanners use driverless technologies such as AirPrint or IPP Everywhere, which don't require additional drivers on your Mac.
In macOS Sierra 10.12 and earlier, your Mac gathers all metadata for the files in a folder, compares it to the folder's .DS_Store file, and then displays the folder's contents. In macOS High Sierra 10.13 and later, this behavior is changed slightly: If a folder is sorted alphanumerically, the contents are displayed immediately, then the Finder collects and compares the rest of the folder's metadata.
You can adjust macOS High Sierra 10.13 and later to make browsing faster on network shares, or to force the Finder to gather all available metadata before showing folder contents.
Samba Printer Mac App Setup
Speed up browsing on network shares
To speed up SMB file browsing, you can prevent macOS from reading .DS_Store files on SMB shares. This makes the Finder use only basic information to immediately display each folder's contents in alphanumeric order. Use this Terminal command:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
Then log out of your macOS account and log back in.
To reenable sorting, use this command: Vb-audio app mac.
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool FALSE
Disable directory caching
Your Mac caches file and folder metadata temporarily in local memory. This improves browsing speeds, especially on high-latency networks. Systems with more memory installed can cache more file information.
If you'd like to disable directory caching so that macOS re-downloads the full contents of the folders and metadata every time you browse an SMB share, you can create or edit /etc/nsmb.conf. See the nsmb.conf man page for more information on how to edit this file.
If your system doesn't already have an /etc/nsmb.conf file, use the following Terminal commands. Note that you must be logged in as an administrator with sudoer privileges to set this file:
echo '[default]' | sudo tee -a /etc/nsmb.conf
echo 'dir_cache_off=yes' | sudo tee -a /etc/nsmb.conf
To reenable directory caching, remove the 'dir_cache_off=yes' line entry, or delete the entire /etc/nsmb.conf file. To delete the /etc/nsmb.conf file, use this Terminal command:
sudo rm /etc/nsmb.conf
Sending Print Jobs to Samba
Aprinter shared by the Samba server shows up in the list of sharesoffered in the Network Neighborhood. If the printer is registered onthe client machine and the client has the correct printer driverinstalled, the client can effortlessly send print jobs to a printerattached to a Samba server. Figure 10-1 shows aSamba printer as it appears in the Network Neighborhood of a Windowsclient.
Figure 10-1. A Samba printer in the Network Neighborhood
TIP
Because the data has already been processed through a printer driverby the time it reaches the Samba host, make sure the printer on theUnix system is configured without any printer driver and that it willprint whatever data it receives in raw form. If you already have theprinter configured for use by Unix applications, you might need toset up another queue for it to print documents received from Windowsclients correctly.
Print Commands
A Minimal Printing Setup
The variable %s in theprintcommandoption is replaced with the name of the file to be printed when Sambaexecutes the command. There are four Samba configuration-filevariables specifically for use withprintingoptions. They are shown in Table 10-1.
Table 10-1. Printing variables
Variable | Definition |
---|---|
%s | The full pathname of the file on the Samba server to be printed |
%f | The name of the file itself (without the preceding path) on the Sambaserver to be printed |
%p | The name of the Unix printer to use |
%j | The number of the print job (for use with lprm,lppause, and lpresume) |
For other flavors of Unix, it is necessary to modify both theprinting and printcommand options. For System V Unix, we wouldspecify:
With the printing=SYSV parameter, we notify Samba that the localprinting system uses the System V Unix method. As mentioned earlier,the %p variable resolves to the name of theprinter, while the %s variable resolves to thename of the file.
Clients might need to request the status of a print job sent to theSamba server. Because Samba sends print jobs to the Unix printingsystem for spooling, there might be a number of jobs in the queue atany given time. Consequently, Samba needs to communicate to theclient not only the status of the current printing job, but alsowhich documents are waiting to be printed on that printer. Samba alsohas to provide the client the ability to pause print jobs, resumeprint jobs, and remove print jobs from the printing queue. Sambaprovides options for each of these tasks. As you might expect, theyborrow functionality from the following existing Unix commands:
The [printers] Share
Testing the Configuration
TIP
If you connect to a print share served by a Windows 95/98/Me systemconfigured to use user-mode security and cannot authenticate usingwhat you know to be a correct username and password, tryreconfiguring the Windows system to use share-mode security. https://hkrenew145.weebly.com/mac-guitar-tab-app.html.
When you print something through the Samba server viasmbclient, the following actions should occur:
- The job appears (briefly) in the Samba spool directory specified bythe path.
- The job shows up in your print system's spooldirectory.
- The job disappears from the spool directory that Samba used.
If smbclient cannot print, you can reset theprintcommand option to collectdebugging information:
A commonproblem with Samba printer configuration is forgetting to use thefull pathnames for commands. Another frequent problem is not havingthe correct permissions on the spooling directory.[1] As usual,check your Samba log files and system log files for error messages.If you use BSD printing, you can change the lpkeyword in the printer's printcap entry to somethingother than /dev/null, allowing you to collecterror messages from the printing system.
TIP
Enabling SMB Printer Sharing in Mac OS X
Edit /etc/smb.conf, uncommenting the[printers] share and making any additionalconfiguration changes you feel are necessary. Finally, enable theSamba startup item as described in Chapter 2,either by checking Windows File Sharing in Sharing Preferences or bymanually editing /etc/hostconfig. Now yourprinter can be used by remote Windows clients.
On Mac OS X and some other BSD-based systems, you can test yourconfiguration usingsmbutil. The following will send thefile named print_test_file to the printer namedprintshare on the serverbsdserver :
See Chapter 5 for more information on usingsmbutil.
Setting Up and Testing a Windows Client
Now that Samba isoffering a workable printer, you can set up your access to it on aWindows client. Browse through the Samba server in the NetworkNeighborhood. It should now show each printer that is available. Forexample, in Figure 10-1, we saw a printer calledlp.
Next, you need to have the Windows client recognize the printer.Double-click the printer icon to get started. If you try to select anuninstalled printer (as you just did), Windows will ask you if itshould help configure it for the Windows system. Click the Yes or OKbutton, and the Printer Wizard will open.
If you are installing a printer on Windows 95/98/Me, the first thingthe wizard will ask is whether you need to print from DOS.Let's assume you don't, so choosethe 'No' radio button and press theNext > button to get to the manufacturer/model window, as shown inFigure 10-2.
Figure 10-2. Setting the manufacturer and model of the printer
Click the Next > or OK button. On Windows 95/98/Me, the PrinterWizard asks you to name the printer. On Windows NT/2000/XP, you needto right-click the printer's icon and selectProperties to assign the printer a name. Figure 10-3shows how we've named our printer to show thatit's shared by the mixtec Sambaserver.
Figure 10-3. Setting the printer name
Finally, on Windows 95/98/Me the Printing Wizard asks if it shouldprint a test page. Click the 'Yes'radio button, then the Finish button, and you should be presentedwith the dialog box shown in Figure 10-4. On WindowsNT/2000/XP, the printer test function is also accessed through theprinter's Properties dialog box.
Figure 10-4. Sending a test page to the printer
Printing to Windows Printers
Sharing Windows Printers
Sharing printers on Windows is not unlike sharing files. In fact, itis a little simpler. Open the Control Panel, then double-click thePrinters icon to open the Printers window. Right-click the icon forthe printer you want to share, and select Sharing.. This opens thedialog box shown in Figure 10-5 for a Windows 98system, or Figure 10-6 on a Windows 2000 system.(The dialog box appears slightly different on other Windows versions,but functions almost identically.)
TIP
On Windows 95/98/Me systems, you may need to run file sharing inshare-level (rather than user-level) access control mode to access ashared printer from Samba. To check or set this mode, go to ControlPanel, then double-click on Network, then click on the Access Controltab. More detailed information on this can be found in Chapter 5.
Figure 10-5. Sharing printers on Windows 98
Figure 10-6. Sharing printers on Windows 2000
Adding a Unix Printer
BSD printers
TIP
If you are using the version of Samba installed from an RPM file ason Red Hat Linux, you might be able to skip these directions and usethe printconf tool, which has support for SMBprinters. Unfortunately, this tool might not work correctly if youhave installed Samba from the Samba source distribution.
System V printers
CUPS printers
CUPS[2] usesa set of modules, calledbackends, to send print jobs to variousdestinations, such as local printers attached to parallel, serial, orUniversal Serial Bus (USB) ports, or over the network using Unix lineprinter daemon (LPD) protocol, Internet Printing Protocol (IPP),AppleTalk Printer Access Protocol (PAP), and so on. The softwarepackage does not come with a backend for SMB; the Samba suiteincludes the smbspoolutility for this purpose.
Samba Printing Options
Table 10-2 summarizes the Samba printingoptions.
Table 10-2. Printing configuration options
![Samba Samba](/uploads/1/3/4/2/134232549/791819628.png)
Option | Parameters | Function | Default | Scope |
---|---|---|---|---|
printing | bsd, sysv,cups, hpux,aix, qnx,plp, softq, orlprng | Printing system type of the Samba host | System-dependent | Share |
printable(print ok) | boolean | Marks a share as a printing share | no | Share |
printer(printer name) | string (Unix printer name) | Name for the printer that is shown to clients | System-dependent | Share |
lpq cache time | numeric (time in seconds) | Amount of time in seconds that Samba will cache the printer queuestatus | 10 | Global |
postscript | boolean | Treats all print jobs as PostScript by prefixing%! at the beginning of each file | no | Share |
load printers | boolean | If yes, automatically loads each printer in theprintcap file as printing shares | yes | Global |
print command | string (shell command) | Unix command to perform printing | See below | Share |
lpq command | string (shell command) | Unix command to return the status of the printing queue | See below | Share |
lprm command | string (shell command) | Unix command to remove a job from the printing queue | See below | Share |
lppause command | string (shell command) | Unix command to pause a job on the printing queue | See below | Share |
lpresumecommand | string (shell command) | Unix command to resume a paused job on the printing queue | See below | Share |
printcap name (printcap) | string (filename) | Location of the printer capabilities file | System-dependent | Global |
min print space | numeric (size in kilobytes) | Minimum amount of free disk space that must be present to print | 0 | Share |
queuepausecommand | string (shell command) | Unix command to pause a queue | See below | Share |
queueresumecommand | string (shell command) | Unix command to resume a queue | See below | Share |
printing
The printing configuration option tellsSamba which printing system to use. There areseveral different families of commands to control printing and printstatusing. Samba supports seven different types, as shown in Table 10-3.
Table 10-3. Printing system types
Variable | Definition |
---|---|
BSD | Berkeley Unix system |
SYSV | System V |
CUPS | Common Unix Printing System |
AIX | IBM's AIX operating system |
HPUX | Hewlett-Packard Unix |
QNX | QNX Realtime Operating System |
LPRNG | LPR Next Generation |
SOFTQ | SOFTQ system |
PLP | Portable Line Printer |
The value for this option must be one of these seven selections. Forexample:
The default value of this option is system-dependent and isconfigured when Samba is first compiled. For most systems, theconfigure script automatically detects theprinting system to be used and configures it properly in the Sambamakefile. However, if your system is a PLP, LPRNG, or QNX printingsystem, you need to specify this explicitly in the makefile or theprinting share.
The most common system types are BSD, SYSV, and CUPS. Each printer ona BSD Unix server is described in the printer capabilitiesfile—normally /etc/printcap. See thesection on the printcapfileparameter for more information on this topic.
Setting the printing configuration optionautomatically sets at least three other printing options for theservice in question: printcommand, lpqcommand, and lprmcommand. If you are running Samba on a system thatdoesn't support any of the printing styles listed inTable 10-3, simply set the commands for each ofthese manually.
printable
printer
lpq cache time
postscript
Mac Connect To Samba Share
load printers
the shares [lp] and [laser] areautomatically created as valid print shares when Samba is started.Both shares borrow the configuration options specified in the[printers] section to configure themselves and areavailable in the browse list for the Samba server. The default valuefor this option is yes. If you prefer to specifyeach printer explicitly in your configuration file, use thefollowing:
Uninstall apps on Mac with App Cleaner & Uninstaller. The first way of uninstalling apps is to use a. https://hkrenew145.weebly.com/blog/how-to-remove-apps-from-starting-in-mac. Choose the user you want to modify in the list, and click the “Login Items” tab. Select the app you want to remove from login, and press the “—” at the bottom of the list. For apps that control their startup behavior from within the app, you’ll want to visit the app directly.
print command, lpq command, lprm command,lppause command, lpresume command
These options tell Samba which Unix commands control and send data tothe printer. The Unix commands involved are: lpr(send to Line PRinter), lpq (List PrinterQueue), lprm (Line Printer ReMove), andoptionally lppause andlpresume. Samba provides an option named aftereach command, in case you need to override any of the systemdefaults. For example, consider the following:
This would set lpqcommand touse /usr/ucb/lpq. Similarly:
would set the Samba printer remove command to/usr/local/bin/lprm and provide it the print jobnumber using the %j variable.
Samba Printer Mac App Software
The default values for each option are dependent on the value of theprinting option. Table 10-4shows the default commands for each printing option. The most popularprinting system is BSD.
Table 10-4. Default commands for various printing options
Option | BSD, AIX, PLP, LPRNG | SYSV, HPUX | QNX | SOFTQ |
---|---|---|---|---|
printcommand | lpr -r -P%p %s | lp -c -d%p %s; rm%s | lp -r -P%p %s | lp -d%p -s %s; rm %s |
lpqcommand | lpq -P%p | lpstat -o%p | lpq -P%p | lpstat -o%p |
lprmcommand | lprm -P%p %j | cancel %p-%j | cancel %p-%j | cancel %p-%j |
lppausecommand | lp -i %p-%j -Hhold (SYSV only) | None | None | None |
lpresumecommand | lp -i %p-%j -Hresume (SYSV only) | None | None | qstat -s -j%j -r |
It is usually unnecessary to reset these options in Samba, with thepossible exception of the printcommand. This option might need to be setexplicitly if your printing system doesn't have a-r (remove after printing) option on theprinting command. For example:
With a bit of judicious programming, thesesmb.conf options can also be used for debugging:
Using the previous configuration, it is possible to verify that filesare actually being delivered to the Samba server. If they are, theircontents will show up in the file /tmp/printlog.
After BSD, the next most popular kind of printing system is SYSV (orSystem V) printing, plus some SYSV variants forIBM's AIX and Hewlett-Packard'sHP-UX. These systems do not have an/etc/printcap file. Instead, theprintcapfile option can be setto an appropriate lpstat command for the system.This tells Samba to get a list of printers from thelpstat command. Alternatively, you can set theglobal configuration option printcapname to the name of a dummyprintcap file you provide. In the latter case,the file must contain a series of lines such as:
Each line names a printer followed by aliases for it. In thisexample, the first printer is called lp,print1, or MyPrinter1, whichever the userprefers to use. The first name is used in place of%p in any command Samba executes for that printer.
Two additional printer types are also supported by Samba: LPRNG (LPRNew Generation) and PLP (Public Line Printer). These are publicdomain and open source printing systems and are used by many sites toovercome problems with vendor-supplied software. Samba also supportsthe printing systems of the SOFTQ and QNX real-time operatingsystems.
printcap name
min print space
Footnotes
[1] Ifyou are using Linux, you can use the checkpccommand to check for this type of error.
[2] CUPS is open source software (http://www.opensource.org) developed by EasySoftware Products. For more information, visit http://www.cups.org.
[3] We have placed annotated comments off tothe right in case you've never dealt with this filebefore.