Bacteria must have means to sense when they come into close enough contact with a surface to initiate attachment. Hug et al. now show that the flagellar motor functions as a mechanosensor. Caulobacter crescentus cells that lacked intracellular motor components were no longer able to initiate attachment through a signalling cascade involving cyclic diguanylate. Interestingly, mechanosensing was independent of components of the extracellular flagellum. By contrast, Ellison et al. show that C. crescentus initiates attachment when pilus retraction is impeded following surface contact. Hug et al. also identified a role for pili in bringing the cell pole close enough to the surface for flagellar mechanosensing under certain conditions. The importance of different mechanosensing mechanisms probably depends on experimental variables and readouts and, more generally, on environmental conditions such as fluid flow.