1.
to give a firm warning in advance; to make someone promise
To warn someone firmly beforehand so that they will not do something, or to pin them to a promise; literally, to drive in a nail so that something cannot move.
遅刻しないよう釘を刺す。
To warn someone firmly not to be late.
The warning comes before anything has gone wrong, which is what separates it from scolding. The passive 釘を刺される (to be warned) is very common.